Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp62961pxj; Thu, 20 May 2021 04:38:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxf2ImyCKuRo3TzaTMk63dYHfRquIJCiZKttblfTMz1XYY1LvLZcPS+l7FeL+YQ7y45oy5n X-Received: by 2002:a05:6402:2714:: with SMTP id y20mr4454778edd.348.1621510714244; Thu, 20 May 2021 04:38:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621510714; cv=none; d=google.com; s=arc-20160816; b=mzmtD7uQwQKtv5MolUciTAk5JQ5utCuXJU0BiLr1eLSWKNed8B0lU534fSOtotdHaM +nJHFef6D83UcRlHHzRlVeP7rGewphipitx24mup+hfBV903+y5owbYVVdan0ARKzkTN DqTa48KiIfs8KO2qX1Gjtls0Odlqi3BaluQDRfQDJRdGoCi6Mg9NLrxL17KXqVn5A8le TcJKZnNmQ/no7UCRdPtcY1b9vrAFsM5bYn2OPVcL3CezjLb37vlaEnlPhEf4vHY5O4tG 84kGK7EYMgYUbaDWMSQP1myWMxk2HQRjFY6zsZ0dLXFAbPDAqe9OEWaFzrG+lpUI2ahd I5+A== 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=LrVClMKal0/41M0mD6omDDjEsEkOYoKokFQUm75OJ3Q=; b=MaFec9/MWzbSyNkIo5MdfV6IzsWd892r+KlpxUq6ETGK/Efu3lBE5+k3fQMeZbZGrh Y9qsBpSug9FH8vaMFQaBLIoijRoF8WVslcbsudIFTKVd9c0C2zO59ZclMJqJ6ovD/w3+ zV92aM5zuspAjmx6JPtdK8kIJsaZKXu9ksL7GePgKcVU1Wf+oYZL33HiiIfUfGNXRR7n 8AIwo2HehcsnJv1PGWF5EtIwDo+Ua+PMmszYeh8PD/J1oVzZ/9BpkjQD5lCR1NaKRFhk wnXeGdwBMamv26xRkGi4cpRGAKwO44j4Xu88vNeXbwTZD2SGG/u1EYeX70UU1hZgEHy4 uMmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OnfjW3zc; 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 j6si2359597ejv.315.2021.05.20.04.38.11; Thu, 20 May 2021 04:38:34 -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=OnfjW3zc; 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 S240599AbhETLiJ (ORCPT + 99 others); Thu, 20 May 2021 07:38:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:38992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240174AbhETLSE (ORCPT ); Thu, 20 May 2021 07:18:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E1A05613DE; Thu, 20 May 2021 10:09:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505395; bh=j8tFkUalTSrNyBkFIfYGnN44fW6MIQg7uDgQV/KITSk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OnfjW3zcX+0FZAtqjZworIIBzGArpRX9VpWXrgXEKYVTR1QjF1lqR8p9Gn3YCXXty ekka81E9RL1eT6CMpwHBIiGjeWkHDhyZNalXqesu4w1odI6r3nEoSCL9qUlGGSOwEU J2ES8d0RTNQayDwWQ0Nds17KFt5eKlmcGS1dgDeQ= 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.4 081/190] usb: gadget: pch_udc: Check for DMA mapping error Date: Thu, 20 May 2021 11:22:25 +0200 Message-Id: <20210520092104.877298249@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092102.149300807@linuxfoundation.org> References: <20210520092102.149300807@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 152c2ee0ca50..5301de1c5d31 100644 --- a/drivers/usb/gadget/udc/pch_udc.c +++ b/drivers/usb/gadget/udc/pch_udc.c @@ -3003,7 +3003,7 @@ static int init_dma_pools(struct pch_udc_dev *dev) dev->dma_addr = dma_map_single(&dev->pdev->dev, 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