Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4594357pxj; Wed, 12 May 2021 08:54:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqS4RDTSMYU5+kSDti0A9buqJaZE0Cmc4tkuuyu2gC2MJ0T9avQt3rARjdDyZnXRBCDg5c X-Received: by 2002:a17:906:f42:: with SMTP id h2mr39375526ejj.317.1620834840723; Wed, 12 May 2021 08:54:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620834840; cv=none; d=google.com; s=arc-20160816; b=mKSywZ+VBMSAdN6bi3g+r9nlYOSL7QCnrx/5neCfKl13ryC6MKQoImJcVHgH3DjGP/ FmW8ILODicU6w36EvxhM/FeCvDXevnGTykv96n8Gcfpd5EiIMOS/dMEGUva2awjocv5e 3/Ncs5VhnoMTc5ZiDhiLi484TksWzXjmXrfc8GSdAJkVF2Pvae+n4WDZd/0++b7jbSed M942S5hzo4CT6FiYj5u3uqp7VdSESYBnM/+pOyFXblsoVKw7RPgcZS+11E0izySn2Xtk t8MzTvK1iQociPQOPcOcf86pP3a++EMRw9NQpCe14OkPJDSRLaH70EydBcOdeInKeadv m3eg== 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=KqTBAbx23MKTIi8rV3PYj0l83t46r1QCzcd9pm+Yj38=; b=DhwDZLUhLogvXNaraMct5U1WVRuq7En5x10xXgriRZ9klTbiHaa1QGN+Xqg7xX+wJp YfXO21xWGlgxdOt1PEFXz0OphRMScMJgKsrGuGAi6r6iCIvdkI+s7pQYD5LEZ6DUQzXQ NEtDmmoIxRjlTtAxZn/KA+4vCdrrgagx4JsiJcB6pSj+pVeWfsXR97PRPJ63scj6iXx8 EUPq/i2bSY4CJR8yiIPZGCYxBxl2DClzTyLlWC4YXPKpFy0Jdcy6kR0IGIUwV6FR1bQt +mn2lfSyFC7PvOUe+HpULfW46VbH/tFJ+QKl4P3QBqYCcW8jhLjuihzI9EELtciLfkfq tViw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QVjDRGAi; 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 a42si86262edf.438.2021.05.12.08.53.36; Wed, 12 May 2021 08:54:00 -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=QVjDRGAi; 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 S237190AbhELPsq (ORCPT + 99 others); Wed, 12 May 2021 11:48:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:58300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233431AbhELPWc (ORCPT ); Wed, 12 May 2021 11:22:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 424E9619B5; Wed, 12 May 2021 15:09:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832170; bh=3akb1bL7YDHH1Y0NUnTEvyh26PYjLk6ZF1bTNAWTBpM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QVjDRGAiW7ND3yxjpDUxcKH31wY9BAV1dusN4Uetp6r30YJEjKdVQpEGqa0jGeeGj VHEpN79/AmJHk3eTK1qkCyNUoyBT48uTBOyGFgVQBpBS52NVrZ90y6WHV+sSKWPPWQ oez0ybNA5eVpQIDjW2JtKXhxnlwHVzY9O35JuNM8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Shevchenko , Sasha Levin Subject: [PATCH 5.10 170/530] usb: gadget: pch_udc: Check for DMA mapping error Date: Wed, 12 May 2021 16:44:40 +0200 Message-Id: <20210512144825.422510336@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@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 b46e9bdc720f..29e89ed6aad5 100644 --- a/drivers/usb/gadget/udc/pch_udc.c +++ b/drivers/usb/gadget/udc/pch_udc.c @@ -2955,7 +2955,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