Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2712539pxa; Tue, 25 Aug 2020 00:41:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRkC5NBCVC0NqJpGIsHKRZEAPrttgbB9zel/abQXi+OWka4PRIkuDp2i9T4hDWtI6uhahr X-Received: by 2002:a17:906:bb06:: with SMTP id jz6mr165509ejb.275.1598341318219; Tue, 25 Aug 2020 00:41:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598341318; cv=none; d=google.com; s=arc-20160816; b=goyLiy5E2a//40A2REQiqEmHm6rNEASL4GO9Be5IxlrpUI+B/KRi0Qi8Ek4XLkaAiB QwTDz6w4iooW4ct6OZzcfeDsCugQzn21TwXDX4kM24yCpcwIEIKLn8D47Xz/gj22hOic OHdmJM9zKdRA+ghgsXDluThWIpuDvwz/DLvrBDjK7Xnq2GtBiZJcqsWltYQj3qaKijcb 35sspuRJ5r4crZqbPHDgJiAOFPIiLR+sJl2qWkrasbhL1cpwPCNuiGhiUSkvLyiWlF+W mreiaCupls0TffPCf35tk1Y4nwh9/gbsAUT1TffVtLY4HgitO+4SX4wZ2n0JTXn9HGtE 8r5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=yea0Yzl3MVzS3ZMBBvStQCGwcTQrcrJmt40gbGzaQqs=; b=PhHRJQdDl8u8wN9ZK0032aEpYjbiTezm9NyZz9ODed8/CxGP000CX/wMuur7vqlcbp j9ablRqIgFiOrHvRZInPXUl01ypJYM9Glww2eRmf213EEf23526s/5YXIe1vTPFQVNYI nYdwD0CnmK54D9O8Gj/9eEIn0REFnwb5kpjmPdVgiIUKD8127R9IfoHlo5x0qtzM2X1U ZaDx9fIQlhwPTzdlmtUHGIaitWZruabgv0KXkBuchuAP7ZEyyoEc/bHf60CXjj4I7zOI mWsiE3h+ihTnu3p1mAaVZk3qeb8ivK8U/ZvYozzu7J7TKMYUlHW6+UnGYZCSwXYVvohw DzgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=xmyrcOxJ; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a10si8431219ejf.666.2020.08.25.00.41.35; Tue, 25 Aug 2020 00:41:58 -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=@oracle.com header.s=corp-2020-01-29 header.b=xmyrcOxJ; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729649AbgHYHiG (ORCPT + 99 others); Tue, 25 Aug 2020 03:38:06 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:33750 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729372AbgHYHiC (ORCPT ); Tue, 25 Aug 2020 03:38:02 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07P7ZDei193236; Tue, 25 Aug 2020 07:37:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=yea0Yzl3MVzS3ZMBBvStQCGwcTQrcrJmt40gbGzaQqs=; b=xmyrcOxJ55uSTkrT2XY5Q6jz0vgx3Kafs7gcoo1BU9/9rDwAmDZZymkPdUjouttDJLjj b3K8ZiBHfplQCw7feE80XBl5OnCgg/9TadTp9hl190N6uEw6CX6EaB4P+LqCJz4UDZj3 WjLDR89Ntj7Zbfj40zWPJAizdNtiT2VHKx5BkzIdA1/YwoI7zAyroC3VP64sk8ytHakD x8OkhjlNr7Lo9z2IYGna7SC16jgHe1rvjCX/6PapSYrmh5sqmxfvPtm+i8JdnIC4Ho7i HBwzhjO1oovICRyINsQ1MZjowb0idHCUqlbWfdC/2Q1qMg0pydX7QEwg2Seiyx7RWYip xg== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 333w6tq9nw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 25 Aug 2020 07:37:40 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 07P7alMC082370; Tue, 25 Aug 2020 07:37:40 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 333r9jj73h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Aug 2020 07:37:40 +0000 Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 07P7bRfL023102; Tue, 25 Aug 2020 07:37:28 GMT Received: from kadam (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 25 Aug 2020 00:37:27 -0700 Date: Tue, 25 Aug 2020 10:37:13 +0300 From: Dan Carpenter To: Alex Dewar Cc: devel@driverdev.osuosl.org, Saiyam Doshi , Magnus Damm , Greg Kroah-Hartman , YueHaibing , linux-kernel@vger.kernel.org, "Javier F. Arias" , "Frank A. Cancio Bello" , Simon Horman Subject: Re: [PATCH] staging: emxx_udc: Fix passing of NULL to dma_alloc_coherent() Message-ID: <20200825073713.GR1793@kadam> References: <20200824142118.GA223827@mwanda> <20200824151920.251446-1-alex.dewar90@gmail.com> <20200824155712.4kgxwqiufm2ieboz@medion> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200824155712.4kgxwqiufm2ieboz@medion> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9723 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 bulkscore=0 adultscore=0 spamscore=0 mlxlogscore=999 phishscore=0 suspectscore=2 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008250057 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9723 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 impostorscore=0 mlxlogscore=999 suspectscore=2 phishscore=0 malwarescore=0 spamscore=0 priorityscore=1501 clxscore=1011 mlxscore=0 lowpriorityscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008250057 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 24, 2020 at 04:57:12PM +0100, Alex Dewar wrote: > On Mon, Aug 24, 2020 at 04:19:17PM +0100, Alex Dewar wrote: > > 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. I think passing NULL was always wrong, but it used to not cause an Oops. This was changed a year or two ago. > > > > 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 > > PS -- I meant to put an RFC in the subject line and an extra tag: > Reported-by: Dan Carpenter > I don't know which dev pointer we're supposed to pass... It would be good to find someone to test the patch but if not then applying your patch is reasonable. But could you search through the file and update the rest as well. The dma_free_coherent() needs to be updated and there was a second dma_alloc_coherent() in the bug report. regards, dan carpenter