Received: by 2002:a05:6622:f08:0:0:0:0 with SMTP id l8csp4489402ivc; Tue, 3 Nov 2020 13:24:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2BSmqjmETg1gfa6soxn3wNE/Lqg5q3XDHtRgu35d1iq1nJdI7XJwEmhCuECLNYguRI4re X-Received: by 2002:a17:906:1381:: with SMTP id f1mr21221695ejc.87.1604438643324; Tue, 03 Nov 2020 13:24:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604438643; cv=none; d=google.com; s=arc-20160816; b=Lnxrf3J1gq487E6Nq0vo9y9uL0laf1dJd/SS0bCC3HVVJes3MbRsfQ0X7e+v2NcwXv MSYwWZuDt52lkXwiyee9E8Ya/vXR3J2+UO5Rv96nHetPI8QDxKuq+9CcJIbLhsATsnhv 7/72kRtg//N6zr2dlY52+2RLQ4SSZWVoH6/Tfpm9OBK9mVIES3gXvHxEewVnp4Bv+aOT s/jGYydusFxYk0bQy6Q7fl5QyD1o+STOujW/CLrF/uddAYwWcN50z5EKk+GgvbxFu6Fg pba58ekhX6MvEKhiT3FPnbvQsHEZcRb97pYCGceSNX9DF5S1+M+H3kWGJ7vVkFzrrgPh cZqQ== 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=6KzdjCivRKw4yTZCrtEMsk5T2rOrVvrd48SALxpZnik=; b=QkozAkUAeY/uZC41yqlS/MtZXQ1GxysZL5/gh6pqm1qIL/2dnlGAzSOFR8VDsD3JUy zTRrc3BgAY4qYr5K1x4UHG1i4xrNChsT2eqrTsYgWKgvo9hFO43n7JTTVh3gXe+KJq4N atSZBIdgNCPvPYoue+muGn/nBDQG1MvfFkWJEfHSBe0MSRIrLwtbhCroJ4+qf0/q1YCA dJl8eE57zqd03Ib6d8QhCZlBBQcwI3iQzgCXliSPcaX1DNd2/3xHzFqBDCcRhirfHmWH G4RXD+5V7nRo/jtWBbCM/XXP0mKCGap0FyCQ1vkwoLjlwKZjQFHOeXPTBMDOEt+zmgh3 WJUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=R+bQW7En; 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 oz31si7089ejb.484.2020.11.03.13.23.40; Tue, 03 Nov 2020 13:24:03 -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=R+bQW7En; 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 S2388156AbgKCVVE (ORCPT + 99 others); Tue, 3 Nov 2020 16:21:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:45410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387966AbgKCVGa (ORCPT ); Tue, 3 Nov 2020 16:06:30 -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 0535F205ED; Tue, 3 Nov 2020 21:06:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437589; bh=JhqZYrzLoq7d1IA7dJCErI9pM2rLwGx0q5SNQ8neXAs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R+bQW7EnX8akjLxnHpP1eGOK5asE3MTKACPJbg6xDYkHGK7VPoNtbpnDuhLJaSb/Y LxKdaAuT+HuoQVr4Jd7VUL8vJZSf4cVvnQ9Oao7z7tPP2HRK/xw2k/VN7T2rGCkQtL j4hu8GD9fLQnwt5M8mF2t02WorVlVBAfJPbMrCDo= 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.19 142/191] usb: host: fsl-mph-dr-of: check return of dma_set_mask() Date: Tue, 3 Nov 2020 21:37:14 +0100 Message-Id: <20201103203246.138514326@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203232.656475008@linuxfoundation.org> References: <20201103203232.656475008@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 @@ -94,10 +94,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)