Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2222828pxa; Mon, 24 Aug 2020 08:26:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmzrV0RyV41ZlW4OfmUSf+PmsoIMZ5uwEqtx5S4RlUlcuyC6Paz/vfv7MjyhuiVOG6hQ8e X-Received: by 2002:a05:6402:1591:: with SMTP id c17mr5794768edv.111.1598282802086; Mon, 24 Aug 2020 08:26:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598282802; cv=none; d=google.com; s=arc-20160816; b=hlLaTjtRF11i0AQez1fpn1YP1KUV0FYDqABxZIBce9wr1SIOZSQyLGH9FelkppC/ZR l01Gg79sTyBroUekwvA62ufRessM2Z26bvIfisCFslGN0PnfC6FradmF6qXpMs3rqjhv fb+0Iet/WisCORFUrwIzzCechN6QOuXtKjhZirmLc6Dus2IIg76zOHM4hzpezMnQ+4mq NeEWbZLTUC+Tybfzy/eaNqfMipf1C6MSKHi0/ce2LcTeWlzK06VMU/0ENBHqeTK+gM95 oVR2LUT3Uj6NgzgWZwmrvbJxHTIH+xbpfpCeppPn1VPnKEXLDVo2ZuNjdxYmIp7Rsg0P S8gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=41TxyHICC+s6aQeo0YedfhOUY4gGQOiE3/gzLfTmhK8=; b=h7dLA9I3DtwskexDb6qRq7Mx1ew6/iFSMB1FzNWr/Pr7w3FaMS199f+bwwcGZmKLTH 3Oh3ZAu6NJL69ng8M9olsgc72uEnubRb7oyRBhy3NFVooJUil+qzWoikdlob1B4nXD8H vlNAE7QeuiW6KAMHgIgi9UrfWdfR/Gch+5dhQyQoxyUpUSID6DDvBbtLu1BetnJaNi6h 6zJ+bDOmlSSTgHwByRYiDHtgCSQY10ewwd2jn9VUEwdMOUM9/hlqwoFLmGtxW/zxzBgI jyind2itypOjn6YFGu5SugdaS4nLKeQenkh1F+8jkWImUPgCpwySZ8qfncRpvwrlc7Dk Wmkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UPZAHY3a; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m7si6801818edq.500.2020.08.24.08.26.18; Mon, 24 Aug 2020 08:26:42 -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=@gmail.com header.s=20161025 header.b=UPZAHY3a; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727970AbgHXPXY (ORCPT + 99 others); Mon, 24 Aug 2020 11:23:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727943AbgHXPWH (ORCPT ); Mon, 24 Aug 2020 11:22:07 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19633C061573 for ; Mon, 24 Aug 2020 08:22:07 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id x5so8746167wmi.2 for ; Mon, 24 Aug 2020 08:22:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=41TxyHICC+s6aQeo0YedfhOUY4gGQOiE3/gzLfTmhK8=; b=UPZAHY3aoz5wOk5QeAlrKi4lHHftgu9RkgR4o5Ya9tKmdXZ5uBTVvic6ApMuVDqhyB XR68EpCvZpY4FuaAZxe9b83xADELgF314JDi4j9vwEaC9F7Aztuff0iAx3Hk8HOmVG1q 4F5/cr83HCraOS/Zj/RsLDTYZ5R137s/z7gAXSeuyMD7PZc/tHHAywxp0Ze6/J+tv78S gvw0ZaXBMg3urwDUFTmw7oawTx/teDC7UYe9e0O+lWAhKF4Luf/UYk9lMUv7AeqEyrR0 KU8/yMYTs+s89yq1xx0RhHJ1c1g+ORsrPhq/BltLM1EOAyK5See4M7vf8kJZrJHyhW1U rD9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=41TxyHICC+s6aQeo0YedfhOUY4gGQOiE3/gzLfTmhK8=; b=lIXCXv13BnjbDInh/uIFp65CmBh+VjQXn8UMCgL7mH8CnTTgN8S6GheJkFcKK/8fyT vOPrK66Oh5j6/jEVhaAdHuyEVpJi5TH4u/bgVVNNYZc/JOxYDurkXRJgPy+m+x6i9oXa KMAVBE/K5NS03Rub05Tjn2XLOLWPu8h2F9uJNuYV0w7+x9PHTdc7Mymhku+ly4ZKs3YE HvaugQTMjNvrTv4pt6BG2D+V1e/13zfi76idHMW7XNyTWiWft71oyueKfDd845L/y4kY jW5rCJvicGpDjLU0UnKPiQYGd83RwxioEW37mmpbj4vX8Mv6mKvSbxCdqUY4PyjOzy0H VLKQ== X-Gm-Message-State: AOAM533tVBtQEdX8cApWiOU0bmSbEYeFwlpPysIqkK00ofGeBGsOQLpD 4YM1pdCehdMRA07vRC4kvQWoH9pbSfGeGn2r X-Received: by 2002:a7b:c8da:: with SMTP id f26mr6315877wml.126.1598282525798; Mon, 24 Aug 2020 08:22:05 -0700 (PDT) Received: from localhost.localdomain (cpc83661-brig20-2-0-cust443.3-3.cable.virginm.net. [82.28.105.188]) by smtp.gmail.com with ESMTPSA id l7sm23730928wmh.15.2020.08.24.08.22.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2020 08:22:05 -0700 (PDT) From: Alex Dewar To: dan.carpenter@oracle.com, Greg Kroah-Hartman , Alex Dewar , "Javier F. Arias" , YueHaibing , "Frank A. Cancio Bello" , Saiyam Doshi , Magnus Damm , Simon Horman , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: emxx_udc: Fix passing of NULL to dma_alloc_coherent() Date: Mon, 24 Aug 2020 16:19:17 +0100 Message-Id: <20200824151920.251446-1-alex.dewar90@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200824142118.GA223827@mwanda> References: <20200824142118.GA223827@mwanda> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In nbu2ss_eq_queue() memory is allocated with dma_alloc_coherent(), though, strangely, NULL is passed as the struct device* argument. Pass the UDC's device instead. Build-tested on x86 only. Fixes: 33aa8d45a4fe ("staging: emxx_udc: Add Emma Mobile USB Gadget driver") Signed-off-by: Alex Dewar --- So I *think* this is the right fix, but I don't have the hardware so I've only been able to build-test it. My worry is that I could be passing in the wrong struct device* here, which would squelch the warning without fixing the breakage. Can someone cleverer than me tell me if this makes sense? - Alex --- drivers/staging/emxx_udc/emxx_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index 03929b9d3a8b..09e91449c08c 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -2593,7 +2593,7 @@ static int nbu2ss_ep_queue(struct usb_ep *_ep, if (req->unaligned) { if (!ep->virt_buf) - ep->virt_buf = dma_alloc_coherent(NULL, PAGE_SIZE, + ep->virt_buf = dma_alloc_coherent(udc->dev, PAGE_SIZE, &ep->phys_buf, GFP_ATOMIC | GFP_DMA); if (ep->epnum > 0) { -- 2.28.0