Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp311044pxj; Thu, 20 May 2021 09:50:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyJAus5Z1ZMA+rDT8WOBAZ5CSjLdtapgtKS+cw9ZS6xNV1Z1AMN83QQ2R305MU7meZLlVR X-Received: by 2002:aa7:d844:: with SMTP id f4mr5814858eds.203.1621529454996; Thu, 20 May 2021 09:50:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621529454; cv=none; d=google.com; s=arc-20160816; b=DbGilZsHo++7zN9j+YNLD3cv0MqVpfEm4PjUpQdT7zS4v6ESZq/bq4mYxVXAP4C1dP E3Ces9cKd3qEsySBmTgHtip4Zx4Y/VZP3AU904NNAn+f4pr+TqjVMHEMopdC2GeNPu49 beHN+DHPknRHVkpa823jsG4S7XQdOuPMn3h+odJpj7IBVwgSnURpANKFsZetqQiKqjW/ UpKmrHx1JCMPI1hz881CHBqT+sY9oVc8p/IHVKpoOLDOE3x2bUH4etLRMguC8KENqWG9 TLG19flC8v066ITzVT9FERas4j8SQcdwkCpCMtk7m5rCNIbUh2IjkHTUVEId8Tm+gn3h IkAw== 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=dXtm2vWqfE0CNDyQGO9bdwwZNXXqaeHiOiipCM3Fvw8=; b=mxP3i5D1rwtBrSkZ3FJeY+9IJffLJYfU1G4iYD7j9b/W0xhiataCCnBc/LJ28LmJoD m06n4bwIV1V1g+44b6QiUhNsvEkdXZwMRu7Y2NIpxG8PRJmMQNz2Cge6NT7+xhwztF8a gWsT2mSBOdjGxrKNuyknHwPdqUAPKTzQJHZR+tbbDGf5+EH9vp+PUSpJAprAgGYTKXa1 zMm00dDLsn3QuNgqmXMqS7XNfy0omTZJ0O5GeQtyac1YnkVL9qOBKo9mxE4hF/PsTV0g 7SBJp6HcC+g00REICK2WSK77Gf1t1YMaR+hvr8inVcln6qLz0SG5ENxgO3/U7HnZV9NS zCPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JdPx3WKJ; 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 b1si2693859edv.272.2021.05.20.09.50.30; Thu, 20 May 2021 09:50:54 -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=JdPx3WKJ; 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 S234734AbhETJyT (ORCPT + 99 others); Thu, 20 May 2021 05:54:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:53336 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232179AbhETJv6 (ORCPT ); Thu, 20 May 2021 05:51:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9E276615FF; Thu, 20 May 2021 09:36:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503363; bh=Gungbleld/3by/u/3r0WsxlqXHH7ueQt0ROCvkLKL9M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JdPx3WKJJj9yd0zj5PgCNE0HoU1AhZARkgbUS2oDJ142PePXUG/gmvb9qXcBGabFt 9SkhoeNrTcy0nxMbFJyhYdJdX6aoVqllTd0ftfSXW9s+alzGGzWGyKWDyHsybeHqIE 8yVNYzH8bNVaTStlskTJECk0gfctdbXlq2ZcATuA= 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.19 180/425] usb: gadget: pch_udc: Check for DMA mapping error Date: Thu, 20 May 2021 11:19:09 +0200 Message-Id: <20210520092137.347652088@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@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 d87c9217cb57..14e99905cbee 100644 --- a/drivers/usb/gadget/udc/pch_udc.c +++ b/drivers/usb/gadget/udc/pch_udc.c @@ -2973,7 +2973,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