From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753224AbbKPRHo (ORCPT ); Mon, 16 Nov 2015 12:07:44 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:60098 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752915AbbKPRHl (ORCPT ); Mon, 16 Nov 2015 12:07:41 -0500 From: Felipe Balbi To: LABBE Corentin , CC: LABBE Corentin , , Subject: Re: [PATCH] usb: phy: msm: fix a possible NULL dereference In-Reply-To: <1447314323-30959-1-git-send-email-clabbe.montjoie@gmail.com> References: <1447314323-30959-1-git-send-email-clabbe.montjoie@gmail.com> User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Mon, 16 Nov 2015 11:07:36 -0600 Message-ID: <87lh9xna93.fsf@saruman.tx.rr.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, LABBE Corentin writes: > of_match_device could return NULL, and so cause a NULL pointer > dereference later. Renaming id to of_id (like all others do) in the > process. > > Reported-by: coverity (CID 1324133) > Signed-off-by: LABBE Corentin > --- > drivers/usb/phy/phy-msm-usb.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c > index 80eb991..c4a66cf 100644 > --- a/drivers/usb/phy/phy-msm-usb.c > +++ b/drivers/usb/phy/phy-msm-usb.c > @@ -1506,20 +1506,23 @@ static int msm_otg_read_dt(struct platform_device= *pdev, struct msm_otg *motg) > { > struct msm_otg_platform_data *pdata; > struct extcon_dev *ext_id, *ext_vbus; > - const struct of_device_id *id; > + const struct of_device_id *of_id; and why did you need to rename this variable ? Please resend without the variable rename. =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWSg1ZAAoJEIaOsuA1yqREe3MQAKtFnts6PrrIwNZyWY6IvFnZ TDGn+Rhh7htcYJwFyK0v5/+qZ55qNJMWR5BnA3vdggAOjTvzpaRK/McH9KWebkC6 dmthIAC+aZ386Ygzoed9i8PWXEzMLUYbVrM6/8OCRbttcwsfyX0hH3DN9+g2R6SR PC7xPM7/B9wPcnk+OTB6bJ+y4LZKVA4OY2qIK7MFEjpfzZSnoQJf9dy5gfAgGqkz Om7T8SG/HM1PoD5tMEXiMJuKw9xJ1RfNg9DnhqtijkVI0HEr9blHkhAeUy0+6swS DCwm/uZXbCEmeNnfWriUtJ3TF8/MYjTuZmNQIBgScXGeGlKM9keDO8QYW5VD1F7w tnZRc9Msgjogz7QuTE9QV6/YyfXIeJ9++QWqKJX3/LAY0Bmk7qOdFgDsO+5Qsw2E ThaCnjfiagFOIc5a9dMVa+zdC3A/EsOCyq4Kr62V1P2WZUK9ZrVH2lE6u+dUW+0f fwS5DcWciSZa0dXmEell4N34y400OjBWm1RNQfqea/IhGL5FS6cc2pM5xqe6gjN9 Ipx11JtGRAWhetvCwSDgNbMcAtjvZ9Cb5j0yQCFGXz5KLHCOEsr/Dhu09HiLilA3 0ImgYvntsQII7y7etdHUPtqN7S6GJUDZOu+Lj9Ke6S3eeofVtjqJBAPWtM0eX4Gf MS/CM9AR1NyHPjSZ0IxL =M3+4 -----END PGP SIGNATURE----- --=-=-=--