Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp433089pxj; Thu, 20 May 2021 12:46:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyX3GK1mGo0zDVZ3Z+KQaY1i8RLMyy7EYQdcTl78JFBYj17NxZ9a2sa5dZaVeWeUfw50pLa X-Received: by 2002:a17:906:79c8:: with SMTP id m8mr6465926ejo.260.1621539983526; Thu, 20 May 2021 12:46:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621539983; cv=none; d=google.com; s=arc-20160816; b=cOj4JeRp1pKuJJnXL4WmSmZJhFxW92gLTOdPfruDteK5I7cUAYyxDQcdUg9bYvz6dS YEZbeAiSArIGWdEH/08qFxArJnL5XSFFqcQLBy88ZTdSEwPJZJ0E9R1oKAwTcu7H+NuI 2AoGgLLshhZlimM2blopXtx3M3gkUyQyN7akUojXOaWjeHyh7bPgJTImzR5vWfX+qqVA no11gFblDQxaMA/EoZwuON9sPSJRgMwdGooCb3wW6mJyDvLR5e6zXRrBqA4yTUCOfls5 GpjtEHin5Ggo6je7iVGyvvOKZAAT7VAKh3CNMFc4bnZ5X624AN2iOyZ4AdF/h2MzAALX 9ljg== 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=7gyr12UHWcpPi8RmO6JDeOV8qLT7dL3e16psj37pFlk=; b=TZPSyHsAXkfFOfHjh77j8TXXz9nmz5SwsF8uPFWHJPTZsh9WQ7n7seU2aCZVxlxhMi DACn/O7FhJPVPxfQbzjvECYNmhpHcsWY11H69uxkWJL7qF+k3MFXqMyrOt4DawLLm43c /7CdI51RzetwoXDidKcraZFQyhgeoydSQXJX/a2REiPC83nK3MCI+Pwczf2lB6BiAWJs RXckpYaUqgEBLDuRjuWtaGHZCUhPkYczdS0wbeaEKlKNfuN7n0x1B72Z7QpbPHxrEZNs aOd1FN2De3oSzurFLv4n4s9Gp2IVpzp84r9B26MS3sGtv2GYqKqF7kd00+SmGIwV6xVn LfAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=P81WJlxv; 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=pass (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 q2si2915836edr.563.2021.05.20.12.46.00; Thu, 20 May 2021 12:46:23 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=P81WJlxv; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236878AbhETKmS (ORCPT + 99 others); Thu, 20 May 2021 06:42:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:55902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236619AbhETK0r (ORCPT ); Thu, 20 May 2021 06:26:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C4D126147E; Thu, 20 May 2021 09:50:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504224; bh=IytorxOreUp8Y+Emxq6ZQnY9Pd/bPsHNTkJ4zeSfeoA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P81WJlxv88LCLlyGusC/o1g++Pl41iraavNfmjLS0nyYqkHcDMf5dcYkFqMnMlpqO PgsnBjMAkjmiD3gyXECnCgsdjW78jEkes+ze7PPeWq2EljOAvOcRd6i8KegI8OFK0N lPTP4o64Y8+FfU/zsf1j5mZ/E2r7R/0COggCi9m8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Shevchenko , Sasha Levin Subject: [PATCH 4.14 148/323] usb: gadget: pch_udc: Check for DMA mapping error Date: Thu, 20 May 2021 11:20:40 +0200 Message-Id: <20210520092125.180213614@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@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: Andy Shevchenko [ Upstream commit 4a28d77e359009b846951b06f7c0d8eec8dce298 ] DMA mapping might fail, we have to check it with dma_mapping_error(). Otherwise DMA-API is not happy: DMA-API: pch_udc 0000:02:02.4: device driver failed to check map error[device address=0x00000000027ee678] [size=64 bytes] [mapped as single] Fixes: abab0c67c061 ("usb: pch_udc: Fixed issue which does not work with g_serial") Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210323153626.54908-3-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/gadget/udc/pch_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/pch_udc.c b/drivers/usb/gadget/udc/pch_udc.c index 1090b846df38..d165c1f67541 100644 --- a/drivers/usb/gadget/udc/pch_udc.c +++ b/drivers/usb/gadget/udc/pch_udc.c @@ -2977,7 +2977,7 @@ static int init_dma_pools(struct pch_udc_dev *dev) dev->dma_addr = dma_map_single(&dev->pdev->dev, ep0out_buf, UDC_EP0OUT_BUFF_SIZE * 4, DMA_FROM_DEVICE); - return 0; + return dma_mapping_error(&dev->pdev->dev, dev->dma_addr); } static int pch_udc_start(struct usb_gadget *g, -- 2.30.2