From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754697AbbFCPkm (ORCPT ); Wed, 3 Jun 2015 11:40:42 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:36147 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752604AbbFCPkg (ORCPT ); Wed, 3 Jun 2015 11:40:36 -0400 Date: Wed, 3 Jun 2015 10:38:00 -0500 From: Felipe Balbi To: Laurent Pinchart CC: Colin King , Greg Kroah-Hartman , Felipe Balbi , Sudeep Holla , Valentin Rothberg , , Subject: Re: [PATCH][V3] usb: isp1760: check for null return from kzalloc Message-ID: <20150603153800.GA31204@saruman.tx.rr.com> Reply-To: References: <1433268313-23423-1-git-send-email-colin.king@canonical.com> <2210713.bNgAhNmNaU@avalon> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oyUTqETQ0mS9luUI" Content-Disposition: inline In-Reply-To: <2210713.bNgAhNmNaU@avalon> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Wed, Jun 03, 2015 at 03:43:23AM +0300, Laurent Pinchart wrote: > > From: Colin Ian King > >=20 > > isp1760_ep_alloc_request allocates a structure with kzalloc without che= cking > > for NULL and then returns a pointer to one of the structure fields. As = the > > field happens to be the first in the structure the caller can properly > > check for NULL, but this is risky if the structure layout is changed la= ter. > > Add an explicit NULL check for the kzalloc return value > >=20 > > Detected with smatch static analysis: > >=20 > > drivers/usb/isp1760/isp1760-udc.c:816 isp1760_ep_alloc_request() > > error: potential null dereference 'req'. (kzalloc returns null) > >=20 > > [ thanks to Laurent Pinchart for improved commit message ] > >=20 > > Signed-off-by: Colin Ian King >=20 > Acked-by: Laurent Pinchart >=20 > Felipe, I expect you to pick this up, please let me know if there's any i= ssue. once -rc1 is tagged, yes. My tree is already closed for v4.2. --=20 balbi --oyUTqETQ0mS9luUI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVbx9YAAoJEIaOsuA1yqREYrsP/3ia+bdaldovfgvG7w+eAsJt JdijfChnVCeTcPBWcIlPJHpCNpMaZuin3O5G8nh2zEPC46t5LDEsRY+9fIHLoZuO L+Q+QK5ZMFX6twRwBBOJa+qiEDn2ZroZ5e5y4BFVbGF64Mh0AvkgA4DDzVy7g6x4 7AtQ7G72ixl+3LVyeGrYpEsgWGP6USTLjqteVPKwre1Sh4nS5lYFMNYaA60Wikb+ QkCCN+PJa2h30ydMsm76VLVFFI//i88KHvuotRRhRltrUJfVYgmJ8TguJwWnCRkd f9ppoheYigrw7RIBc4EYmSeSxvh5lc8RhGQhsEReemoiIF2d7RPmKevYUw7eE8c6 Ogd1C9sLcY/h9BTP68Y/guZA3qXnVV27sOnU0Q34pmSNQ1rbP4FUrSooYpID7Y4w auu9t8Bgn7VxnrWp6SLsHcG5n/aZxJxqm/XQtG9yjSX7SEB9fFl9wGjfnWVNFFyW 5Y97skZbjXPNObv2DlSoNHZpNfh9ZO06uSTTzTqIyq5wKEYyKzlt73LGvcDY13zQ HPgQ0ed1zzbyceV9zrXlsMfgIUzBCny8i4rLFM0p8pwkaSiTcEaMcuecJHWHZEEG 1sEsm+cOoBXPudJH6eSmdHlDqIoVjord64ThCqsQqo4r8oG6mwxvxygM8QoajC49 WGJZV0RPuViiUgMHenSn =hEDl -----END PGP SIGNATURE----- --oyUTqETQ0mS9luUI--