From patchwork Tue Nov 3 20:37:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 317025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9087AC388F9 for ; Tue, 3 Nov 2020 21:16:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3D199206B5 for ; Tue, 3 Nov 2020 21:16:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604438160; bh=XgqivWphlhBxKy56iG2H0agN9XDtO3Gpwbhw7LIjMNY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=BLXFTHtJy+p8nZMgACm9mTvwMM38dNmf2FSOurAufnEkwolNKFDEZnyqjXfuokjLV BdoCK1m4GjDPbL21xZkOD6E2jCeGzt63uXGCEuInuHaAIeNtuZVM1Esg8Ag42TgXK/ vE7P4J569UuGeCh9bu9/HCDSHga0tPm2G54sr14A= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388913AbgKCVLq (ORCPT ); Tue, 3 Nov 2020 16:11:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:53710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388911AbgKCVLq (ORCPT ); Tue, 3 Nov 2020 16:11:46 -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 24CF8205ED; Tue, 3 Nov 2020 21:11:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437905; bh=XgqivWphlhBxKy56iG2H0agN9XDtO3Gpwbhw7LIjMNY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dHJn09dpSEyJD0Moo03gBSbE/z7f3atYmzx9mP/xHuluh19ZiF32kokmIB62WFH+B 23x72Eq891gfVEregAUueZfSUnCeq1es0ZhNi78RtFoK/Y45mHsmoUiNKDEcKnP1V0 S5N96Zsjcn/mB74fcZafylfZ4tpkXwNunejVj4bo= 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.14 082/125] usb: host: fsl-mph-dr-of: check return of dma_set_mask() Date: Tue, 3 Nov 2020 21:37:39 +0100 Message-Id: <20201103203208.800084716@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203156.372184213@linuxfoundation.org> References: <20201103203156.372184213@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@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)