Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3219118pxu; Sun, 11 Oct 2020 01:31:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhWnq/eJw5ZK+kZrgUrqAB8tmwTLo2WCvChYolGTFi5viJ63iFYhlDt196yzmKCmh11j05 X-Received: by 2002:a50:d4dc:: with SMTP id e28mr8421462edj.137.1602405113530; Sun, 11 Oct 2020 01:31:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602405113; cv=none; d=google.com; s=arc-20160816; b=Rj6LdKiF9Cf4/AxLleHVOx6+sGrTIfTnkhQmTg77srJbuqoWJdRd4/pvKXztH+Qo8K lfTYL95RH3GZkS1Rkw5ioeWuqBbMckDgi0OLeuKUeEFa/GGuZIntGP8YOHW0cS5DGwOW KNTDkZWNeAUFb9pnamk7EQMIg3uVXCyS3S/Qj72LX23AeODPV3D/kQg4laGBjpVVCr6y TwqE80Fg4VDHOJLG9lmX1sfWjtYCq2GQCQ5l8Do15ZSouj4ZfNTKRaBD4K8qzJMbjSVr Db6XGIXTiEoVm6U4qyrLqeh7niu5sk9ESlnM9CJJmqD4ccWETciNMPxa02y2HCLcavLr aRTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=cStVAH4w0kbG6kUmYArXGWqIvwI26J78WDWU/DMpiZw=; b=JG+bNk1C8AT01tbbXegfGGZdhEPvNv9y2SldV3TaUAydnvrnQG24Aq+r90ujgN5KVp thsOcb4HwyYNs/wQDzHG4C4u5QcqwoDPIhASojvpAZyasirfw2ecyVcytzztf/Plc9XK b4Ny31JUL6Aolcx4MJ5OgrGXt6gMoOt0B9GWOUK25oPuE+jwWNpzsbnFbd4YpXS60oPa Yqv9zbk884PU6o/vWLChTCs7ltJ6kdR1Q3KBOPUYnTFZmzyfybCDXE1625/CHxcOhSSy kXvE6Hyum1pd58t59nrFJfFhQ/SMj8O/YXenXvXb5a93Gb6Jf2+fgaYZt4tNU2O51vRT 6tlA== ARC-Authentication-Results: i=1; mx.google.com; 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=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x8si10101665edq.532.2020.10.11.01.31.05; Sun, 11 Oct 2020 01:31:53 -0700 (PDT) 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; 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=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726371AbgJJGNZ (ORCPT + 99 others); Sat, 10 Oct 2020 02:13:25 -0400 Received: from inva020.nxp.com ([92.121.34.13]:59746 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725802AbgJJGMr (ORCPT ); Sat, 10 Oct 2020 02:12:47 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 113D81A1168; Sat, 10 Oct 2020 08:12:14 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 6017B1A116A; Sat, 10 Oct 2020 08:12:11 +0200 (CEST) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id A34F7402AA; Sat, 10 Oct 2020 08:12:07 +0200 (CEST) From: Ran Wang To: Greg Kroah-Hartman Cc: Peter Chen , Jun Li , linux-usb@vger.kernel.org (open list:USB SUBSYSTEM), linux-kernel@vger.kernel.org (open list), Ran Wang Subject: [PATCH] usb: host: fsl-mph-dr-of: check return of dma_set_mask() Date: Sat, 10 Oct 2020 14:03:08 +0800 Message-Id: <20201010060308.33693-1-ran.wang_1@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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") Signed-off-by: Ran Wang --- drivers/usb/host/fsl-mph-dr-of.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c index ae8f60f..44a7e58 100644 --- a/drivers/usb/host/fsl-mph-dr-of.c +++ b/drivers/usb/host/fsl-mph-dr-of.c @@ -94,10 +94,13 @@ static struct platform_device *fsl_usb2_device_register( 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) -- 2.7.4