Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3212066pxb; Mon, 9 Nov 2020 05:43:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxRk0EDVXANumSBNMTlVntyeVqU17uXeHj+SYUDiAXVHVAaXeJtlQequ14QJVVHnly4dz83 X-Received: by 2002:a17:906:a149:: with SMTP id bu9mr14657583ejb.115.1604929416256; Mon, 09 Nov 2020 05:43:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604929416; cv=none; d=google.com; s=arc-20160816; b=NX/cC+nMILjJF6dqs10oS+m5bYE8srRtGC1cDHpP1pEt1U9e4zz52f/10hV3HDigBj +a9s1OIq8kPtdZ/Xkz3pPbZN35TRv2aEI/PFdvLCuKOGitwSHI5EAXTfjaPv3umlQnlB zpZynkqMqx482NF6coPwkmLSI4KxLbSBrLIsiAmkUNeFk+CaLGNKO0QOFAmzjWEKEo1Y UvHwNVPkYTH1JLacGIY6Hn5eDVh8VWfWp3kl177iOdj4damkuXCZKvut07ACWC8qEbHY +2/y1ROA8s7ALrN1TEB5key3FIfXzhkGAZssij5rWLDNyok+YIQXdd7D3Sqpq4s6hMy0 ZQSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5fdaE5xXHCye164bMyx5yjcSdWxp9B/RszUZEENl8+s=; b=K8lSWR6bVvNCpW+znxA1gMGxC3V8kblgMlPKSaoQgTyWozVK399lpyWnGQiOgHgbMi 9Afku7CjOpPC8RxtZEJ5j4cPJC5zU//JgBH/iP8R5PUh370la5ZlPnDaQ8CiqB1+VYeg 9TSIwoubztlJVy8HWcfY2g4MrEIOAI5q0C3bBSUGaJgD8K5OMpicEJ/gbHKoSDUBakKh +bfgliJkdR6I04GEhkl+MXseVMPsJqK45/PE9p11IwXZONrDG1tyQvIMy5sGqT1zbVqb YLCc4EPcdNbm92aExqA7WXDVPjvH0RimwlMKccxDVjpNtlcDiEI/UjW4aj7OggHclKna QQ7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IvCuVw0t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m20si6949148eje.363.2020.11.09.05.43.12; Mon, 09 Nov 2020 05:43:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IvCuVw0t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733169AbgKINj6 (ORCPT + 99 others); Mon, 9 Nov 2020 08:39:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:56284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730655AbgKINCk (ORCPT ); Mon, 9 Nov 2020 08:02:40 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F3BD0216C4; Mon, 9 Nov 2020 13:02:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604926956; bh=XgqivWphlhBxKy56iG2H0agN9XDtO3Gpwbhw7LIjMNY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IvCuVw0twRRERZd3gQ7AuNnbcPBCr7fgYSsBeq5tJPqwdd4pWyhdsYyGYrN3no0w7 aRygnNeIh3/8GkzAS8pNonndshhQ+sVP1P2ORRYQINtwwrRwu1zjTIThD0+OquYUPf s9TysVRl/CO8mjOvpgwaG1Qr3hPfCkDDXE1GVmxs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Chen , Ran Wang Subject: [PATCH 4.9 062/117] usb: host: fsl-mph-dr-of: check return of dma_set_mask() Date: Mon, 9 Nov 2020 13:54:48 +0100 Message-Id: <20201109125028.607536410@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125025.630721781@linuxfoundation.org> References: <20201109125025.630721781@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ran Wang commit 3cd54a618834430a26a648d880dd83d740f2ae30 upstream. fsl_usb2_device_register() should stop init if dma_set_mask() return error. Fixes: cae058610465 ("drivers/usb/host: fsl: Set DMA_MASK of usb platform device") Reviewed-by: Peter Chen Signed-off-by: Ran Wang Link: https://lore.kernel.org/r/20201010060308.33693-1-ran.wang_1@nxp.com Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/fsl-mph-dr-of.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/drivers/usb/host/fsl-mph-dr-of.c +++ b/drivers/usb/host/fsl-mph-dr-of.c @@ -98,10 +98,13 @@ static struct platform_device *fsl_usb2_ pdev->dev.coherent_dma_mask = ofdev->dev.coherent_dma_mask; - if (!pdev->dev.dma_mask) + if (!pdev->dev.dma_mask) { pdev->dev.dma_mask = &ofdev->dev.coherent_dma_mask; - else - dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); + } else { + retval = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); + if (retval) + goto error; + } retval = platform_device_add_data(pdev, pdata, sizeof(*pdata)); if (retval)