Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3987182pxv; Mon, 28 Jun 2021 18:37:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWGbEFp98H85YiMAxYlA17vsW4CMcJZ44BNGDavEHw1iI+h8AdkZmp+N9PysyGVR68XYMB X-Received: by 2002:a05:6e02:1183:: with SMTP id y3mr2633247ili.199.1624930625419; Mon, 28 Jun 2021 18:37:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624930625; cv=none; d=google.com; s=arc-20160816; b=Rt2y/HQs1dUsmjbVFP5Feix/3Ef0+NBbYCPsJ/vwNylIcxk/YgwRIBWfW6SZdZiPFq JSaUWbVq3We9vFWyVZMLPEqIF27THcGN99DzRwbnGDVGrXS1RuSL5Hfad31PYyaKf5jj JFOQaXacLqsZ8lyB+a7WBUW5cb/mjo2QNEszDlffY3TNdMZSjNmmat2Et+dVDRPRPiJ4 Q7ppaVlvMm9G+mI5z8mt8dwlBcNKslU5iV42LUjVIiMHe00rn9N5sUr9VdZ6/IG8EqYu RzWDsXEo8PCBMy0FHmAqor95O8BjUqXQinyPK7+UqhyQsuLxbdLioKQmZafvWf8shsWY nRlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=cmaRCt1OUl63KXq6ICbb5i/i4w2RpcClgG+yfZ4WrXI=; b=UnfW6VTABTnK42dn25iJPVxJ7TyeRKZ1dtBlDpV2ITRlXolWGE5GuTw4iMWu6NtvOe /f9c/53jHAGBKBhaF5srAx9BPWlTCZFmzucmxSYwx4sKFvIDwGuPGWzGk31JJ/3Dq7x7 rQx4qmPinDWMKk/KdjrPEmj5LZ3cLWuWGar32WxRJloKcd/S/GnPMjIjAXg8nGf5HQ4z Re2GUDiLz1Ia7NNuFohWYlzatyZDcm2a2CoK8x3ngVgyqvECY9oHlBqXYYSsF7u8ypOZ pXLI6kLU3VS6yNG/pK1Up/yJ++B0bTDzvHu9Y3Jkbe4AgszKVQ9NHxjmQMuU9PJDnbhA pwrw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u1si22883630jat.64.2021.06.28.18.36.53; Mon, 28 Jun 2021 18:37:05 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232087AbhF2Bio (ORCPT + 99 others); Mon, 28 Jun 2021 21:38:44 -0400 Received: from netrider.rowland.org ([192.131.102.5]:49805 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S231947AbhF2Bio (ORCPT ); Mon, 28 Jun 2021 21:38:44 -0400 Received: (qmail 680473 invoked by uid 1000); 28 Jun 2021 21:36:17 -0400 Date: Mon, 28 Jun 2021 21:36:17 -0400 From: Alan Stern To: Linyu Yuan Cc: Felipe Balbi , Thinh Nguyen , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Jack Pham Subject: Re: [PATCH] usb: dwc3: avoid NULL access of usb_gadget_driver Message-ID: <20210629013617.GA680339@rowland.harvard.edu> References: <20210629002029.6295-1-linyyuan@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210629002029.6295-1-linyyuan@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 29, 2021 at 08:20:28AM +0800, Linyu Yuan wrote: > we found crash in dwc3_disconnect_gadget(), > it is because dwc->gadget_driver become NULL before async access. > 7dc0c55e9f30 ('USB: UDC core: Add udc_async_callbacks gadget op') > suggest a common way to avoid such kind of issue. > > this change implment the callback in dwc3 and > change related functions which have callback to UDC core. > > Signed-off-by: Linyu Yuan > --- In general this looks very good, all nice and simple. But it doesn't cover the reset callback (dwc3_reset_gadget). Alan Stern