Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp545031pxj; Thu, 20 May 2021 15:51:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAxb/gocoWRP7sTWWbPWtbxVzrmWznzN/IzjkWTftz90GC3T3bpZ0xzpBDrInNhSIJFpRk X-Received: by 2002:a02:5b85:: with SMTP id g127mr9372625jab.80.1621551076960; Thu, 20 May 2021 15:51:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621551076; cv=none; d=google.com; s=arc-20160816; b=ovjkJphx5/yKbvE8nLn1SXgFW0Rane9P8RNiYeSar9R+TXcJw0DQ412ySYUqTb6OuA rF5k4og05S9gu6P39UU9ISUF9A7Lt8Vsd+fqMRYqtsZPPB9IwKeZ1EWIGN2FfvW+e/AU 8COQz9a4R5TP1ktOUZCYywPgf9e7o5Tg3E1+dy7QlBZnaQgggbTJxQ7Mc6QteNJvh/1z XFW+MqkRdJn5kG3vF0Qm+LbkW4FGr8dCwS8zXnB2baHcDQoMWHLi7r5x8UE09clN5zLW oMbg6tggi9jXfu5f6l/RTSOcxZP9745N/dN9HQ2Fy9lk1DM/BZgTwNmCqLcFLn9Lv1GE p2BQ== 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=X/4McHyTLfTGc/rJRCnBcpzI+9aUkEGKBHXtL3F9PNU=; b=yGmjcB2ZA4iZXd43iwUpgUXkYIDpdWp5X/PdOwPESsH5b8m340UlHyFRXDHekHNhc4 3gSjI09uO0KHsk+Y2mv5YgbJg+fUY5xWwGnjDHW77yfrKMXKYLUW3Cc1DAKeC8/u1Wcn cgi9UgikLxffRSXFX2jA/kNIAjyneEi+1/GRft8gEAyId7mN/Yri5V/BqVEanVxVqG2M b1pEKPjPn9BBsX9peMMndUD6GDuDb/k7h99eT8TArYtnoYxwCFMWh/94QsHV+pIvWGWU RfRN59JUQ6wyV8Zxeq4z15ZffZyL1tRYDHkvQhdpsNLwZXn8/gwlq83qgzRsWtrMRAqv Bc+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=meRi4LTa; 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 s18si3812883ilh.102.2021.05.20.15.51.03; Thu, 20 May 2021 15:51:16 -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=meRi4LTa; 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 S239314AbhETLNT (ORCPT + 99 others); Thu, 20 May 2021 07:13:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:52986 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239214AbhETKwn (ORCPT ); Thu, 20 May 2021 06:52:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5754D61CD5; Thu, 20 May 2021 10:00:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504826; bh=kred/3Y+47CwYfuZZ2Gvaz35zdpmNQ+exjYpjNen/bI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=meRi4LTaYy022+bKxmhdiqDag5P99LfsG7pa91WYxxVosfDkVSIyvZZ4H1qPKHD4S P5vxWkXlX52jcAmzAEabbRGqL/f++TvvIYa60cC77bISbeVUmp4P/xkN3G34xQacyw 59MwsBpxNeqUsjyMeNcEf6roXecT34E5VAb3KLwE= 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.9 098/240] usb: gadget: pch_udc: Check for DMA mapping error Date: Thu, 20 May 2021 11:21:30 +0200 Message-Id: <20210520092111.984962814@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092108.587553970@linuxfoundation.org> References: <20210520092108.587553970@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 2363e3f66647..18ce19162804 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