Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp402657img; Wed, 20 Mar 2019 03:08:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5WcLFnZXDdSqrlK+DHo76C+6V03da+s6DcnwdFX3bOW5TsqUDYB69Rs3GOCBhIGy3+T01 X-Received: by 2002:a62:1d8c:: with SMTP id d134mr7176733pfd.185.1553076530064; Wed, 20 Mar 2019 03:08:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553076530; cv=none; d=google.com; s=arc-20160816; b=EV3XBAO/nG9b2LdIdxWPaOBnM8CwYsNC18QEfD02tPnabD2oCEiRii/Td1hKVTWJYA vnE8ZH9eJ0fkbtlEx/q06vVgSLa3iF1IRzENb1pOvWcjMNx/AxAttYFBbmEwr0QB1ooC mKauT2LKX6pY/3EB6UDzo4De65OkFcCOeftRbu17IfBAobamlwjjRIA+Co3N3CFIvX5+ gN+v3sReGwN35e9IkuDzFpYD/YYUdxVIpmMl8tXYVbRSyRCjS4Sb6nD5hpKvTXgY1ZyW fkgbYitCERu3AYFu3wL8BWEK0i6IZhmDv1YTiajWh4eXsOo/kmL2F0CjSFqaD3dogCAu O8rA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr :dkim-signature; bh=dD2x5dB0que8y/t1y0m4Wn6w+cZKdv0wihNR5usE+xM=; b=DoQt86AckDK3nbvy24D0gphylPJ8YZohZKgnFxph8AaXQIRQG1xjh4pPg9B5ZGua6U w29Q0USSGpAtzNF0JnjeMqNEZspHdp+6vFZfnaRxAiiNw/74UyaIsYK/HZd43xC2hyVG t9AFtEsBJy9QI9ZxN7QQMi7kdeo/7D2OVsqYBo6hnJVWHu80e/9OQnYYAR8z+wc03hU+ w7Bm1JkQA21uuXxICYdaKOA/4x4+mAF/ubXyvQ5KiBy5+7Rvvm2yNoyscgghQTTEdNUN WPP5xTvyqv7JbD1siFk84fdqnxamQvyVRFazc50iUZoVIa5KYRq1vOx726b5nDtTadaE 9CGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@skidata.com header.s=selector1 header.b=UbE1R924; 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 f1si1320897pff.246.2019.03.20.03.08.34; Wed, 20 Mar 2019 03:08:50 -0700 (PDT) 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; dkim=fail header.i=@skidata.com header.s=selector1 header.b=UbE1R924; 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 S1727967AbfCTKH1 (ORCPT + 99 others); Wed, 20 Mar 2019 06:07:27 -0400 Received: from mail1.skidata.com ([91.230.2.99]:55594 "EHLO mail1.skidata.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726875AbfCTKH1 (ORCPT ); Wed, 20 Mar 2019 06:07:27 -0400 X-Greylist: delayed 429 seconds by postgrey-1.27 at vger.kernel.org; Wed, 20 Mar 2019 06:07:25 EDT DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=skidata.com; i=@skidata.com; q=dns/txt; s=selector1; t=1553076446; x=1584612446; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=Yf98xqdSflMmZyDCVuR+0USkBzTHlthe+01vNzwTUXI=; b=UbE1R924IZyiwp2MYQPKdotrPiMrE+W12WYSIFWbQRzJ+/4qCsalqEow AniIrWC+ZLr6C6kxVNzKr+8vq5RzpDpS9S0VH46iiNjzHi++2KGld5efr YqyG2U3sY/in8flU/pb4SoxVO0RCZAUD/GLCis+2bJTDk7BYlfL+XcN16 fcM94Sp5b7K/NS6uqevw948DA7u023t9lNBiwJaa4N/dCs+y9yQH6k4aA vY2jxpXtAmjdr/acAjXQygekgJJ7y992zRyQuv6521ZROe1SWe0zzKlSz rYqdTocNsf6/B++RZCmO7mk0zI48QgqBTSr3XTziSpFkdvoGO5bNpsVGK A==; IronPort-SDR: WXU+rwwh/2StGNNA0EzHogoIhiBN79nS8MTeV8jIb0PbBn3JPIQHqG4yTd4inYaQQvA0QOhTfj WGgbYY9qMoFibAeNGF9FmQ+3L4MBBEa7+nsMDHYz/zyzM3Fi51oOZxLtXs5EsqkWxwHEwt8cxq xuDKmV7KYNR21ZkHTDMy33RWkJiJCY/R1umXI+S6oe7s3X9FnZyJDr9YfV6TiTbad+64NwAN85 TMoqAgBKdTdA/XOF9KkWXCZMudMQxNegFoftnhKKGWBQgZaKSC5x+i4DsyPcbTQI6g4GH1xXm0 HXY= X-IronPort-AV: E=Sophos;i="5.60,248,1549926000"; d="scan'208";a="15864786" Subject: Re: [PATCH v2] usb: usb251xb: fix to avoid potential NULL pointer dereference To: Aditya Pakki CC: , Greg Kroah-Hartman , , References: <20190319202658.17116-1-pakki001@umn.edu> From: Richard Leitner Message-ID: <593fcaca-8732-94b0-08fb-b1c6738cd688@skidata.com> Date: Wed, 20 Mar 2019 11:00:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190319202658.17116-1-pakki001@umn.edu> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.111.22] X-ClientProxiedBy: sdex5srv.skidata.net (192.168.111.83) To sdex5srv.skidata.net (192.168.111.83) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, thanks for the updated patch. Please find my comments below. On 19/03/2019 21:26, Aditya Pakki wrote: > of_match_device in usb251xb_probe can fail and returns a NULL pointer. > The patch avoids a potential NULL pointer dereference in this scenario. > > -- This should be 3 dashes "---" ;-) > v1: Fix to avoid return in case of error, per Richard's suggestion. > Signed-off-by: Aditya Pakki This signed-off-by line should be in the commit message, not the "version history" which is not included in the commit. Apart from that (if you send a fixed v3) feel free to add Reviewed-by: Richard Leitner regards;Richard.L > --- > drivers/usb/misc/usb251xb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c > index 4d72b7d1d383..bbfdb7447d6f 100644 > --- a/drivers/usb/misc/usb251xb.c > +++ b/drivers/usb/misc/usb251xb.c > @@ -612,7 +612,7 @@ static int usb251xb_probe(struct usb251xb *hub) > dev); > int err; > > - if (np) { > + if (np && of_id) { > err = usb251xb_get_ofdata(hub, > (struct usb251xb_data *)of_id->data); > if (err) { >