Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp930348imu; Fri, 25 Jan 2019 13:39:48 -0800 (PST) X-Google-Smtp-Source: ALg8bN6hWj4VFu0YZAuGfU5JY2gs/kCZgJQdDU4jVvmlXIVuLAA4QRQ+q8edUE8mDTvJq4HYH1to X-Received: by 2002:a17:902:848f:: with SMTP id c15mr6255259plo.119.1548452388134; Fri, 25 Jan 2019 13:39:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548452388; cv=none; d=google.com; s=arc-20160816; b=TSIn1g0bme3dOUs998pPu+kbp64l/Lqv8qILDHqFQUu2zhhY4lZ4paqJT3vZk6+V27 fVyKucWd3ycC7Ux8X1be2CJd5RkEri8SwULXVWScBZlD+2anhz2DuKzoOafZ02N3Wfu0 3JacdgBPbQigKTCon8xD5x6FisCX8UTQopp5hD6coBjZX3CSwWiTnbE1VfjzW7EDhxGm OFy2mW+8plJp8NIgvXAfZ0N+H1uWOIgsaesK5JCmzZ7FVKvLNnSYadSYhSjVIoNTHPfk +VaqdbiqoAahI5CdPzMn9oW1I9dn6mhO3Zja/L7XcitR/G05VmBFFBn+5dWG9E6DSRzs EkAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=48kiVttcYvdnfPv7uhUp4VlS5EDfn8+1+CdcZlOuECk=; b=HhqrHBY7schtJJ+mVHMtY+44ItFVkk/DC1ng1c+1mL+WGtxOyrT6eCE7aDSXYLE23t urNmhzkPSjCG2KbnqPJA/HXrTKZ+EFJ10OkCznbxsJwdcNLK8Q9Yvz1ot/cYize7opEv FKGxWisRwixSOtWYpxSrFhGMO9Oy+AnpOTJV3B97xLQIZyyy3IDd+Md1/7u2OoaCU5a/ Nz+BPPOhwCTIvZQtghA3VYIG4WUB7opPuCmlgklUqRgujF/pStGlg9/Svi06IOIiEL5T j5zTNJQYGZ2IlgQSVTvd2cZ9uT2wtgCxVk55cyRm4Ejr9xJeKoMI3sKxVxKRF5WjYiMX HwlQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k38si26359801pgi.235.2019.01.25.13.39.32; Fri, 25 Jan 2019 13:39:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729414AbfAYVht (ORCPT + 99 others); Fri, 25 Jan 2019 16:37:49 -0500 Received: from netrider.rowland.org ([192.131.102.5]:45553 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726329AbfAYVht (ORCPT ); Fri, 25 Jan 2019 16:37:49 -0500 Received: (qmail 4528 invoked by uid 500); 25 Jan 2019 16:37:48 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 25 Jan 2019 16:37:48 -0500 Date: Fri, 25 Jan 2019 16:37:48 -0500 (EST) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: Bin Liu cc: "Matwey V. Kornilov" , Greg Kroah-Hartman , "open list:MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER" , open list Subject: Re: [PATCH] usb: musb: Fix potential NULL dereference In-Reply-To: <20190125164412.GJ18982@uda0271908> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 25 Jan 2019, Bin Liu wrote: > On Thu, Jan 24, 2019 at 09:47:02PM +0300, Matwey V. Kornilov wrote: > > By the way, why do we need to store the qh in urb->hcpriv? > > qh can always be accessible through urb->ep->hcpriv > > Wouldn't it be better to drop entire urb->hcpriv usage? > > I am not sure why. The code is there since the first commit in a decade > ago. But I tend to agree with you. > > In a quick search for urb->hcpriv and urb->ep->hcpriv, based on the > usage in core/hcd.c, it seems to me that urb->hcpriv should not be > changed in each controller driver, but I see both have been used in most > controller drivers. I will leave this to others to educate me. In some of the older HCDs, urb->hcpriv != NULL is used to indicate that urb is on an endpoint queue. Perhaps that usage was copied. Alan Stern