Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756912AbcK2LQG (ORCPT ); Tue, 29 Nov 2016 06:16:06 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:55869 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756713AbcK2LPz (ORCPT ); Tue, 29 Nov 2016 06:15:55 -0500 From: Arnd Bergmann To: Maninder Singh Cc: robh+dt@kernel.org, rowand.list@gmail.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, v.narang@samsung.com, pankaj.m@samsung.com, ajeet.y@samsung.com Subject: Re: [PATCH 1/1] scripts: Fixing NULL pointer dereference when pos->file is NULL Date: Tue, 29 Nov 2016 12:15:38 +0100 Message-ID: <5877520.Sj6Wky7ff7@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <1480415699-35335-1-git-send-email-maninder1.s@samsung.com> References: <1480415699-35335-1-git-send-email-maninder1.s@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:qwqCSCqVRtsq9Xf+8HX3uyfTquXcM5kHr8MBWVQt94NliKuK9JV 6K+mca+xp/nekG5ED+Abl4h1SogPEA5GbH+S1pYIA+n8ICCgdZ56fNchU8wqtxG9q2ARu57 VRe5k76RIbHX49+AHrzncNAEbyGS2iUyxzAR3TcZnFF0NaAyRUAZil/JrkTthaUuDOTCehA lujIDx8/t3PMyB2W9OTfA== X-UI-Out-Filterresults: notjunk:1;V01:K0:MsHnTMyf5No=:+C8aHKPdUD431SN2VFz+Cm jkvrrOGSdf+MtVesVmEttW7FGY5iPs5uiSdJorto+akgigKBoOemLsqgCc0IBbKTWyM9Ifg34 k8wGxmqdsBpl8f65Zj8kfAJME2NdRk/Pyi8cXkg3aAjev6i64J7cQGjCZz8tYm4uvTvBssIk6 Cno2AHs6pVkkL0rqUbQCiCSbXRR7utF+WVIfm1N9m6mzUBzxAHRoEu343EWBvxHefGwnCiuvJ iwN/ubDll3mGxeqe5YU4Q7ofeiM0oGTTlB9kteUKdOAWIP/VFLlLTXih4pok+9vCqz/yYNb29 cb8LXijFU3ag10AoCEo+qpObhgvNEyIwNAq2TKk+t3e+Gm95mmVWxTPcxYwu9FgbgUgk5oIfd /WO4brUowr0ktxhMnWsOHmVf/Q0cGmDnsy8lVDG0y9y7dgRCCBfBFZUkK5ZfHgUMvWJbOHyFK FqXotBH9sSQktqsEMar9y4ZvvOY6WKUeCOXm5U4ROejAj4EnoYxvkETiKtsWB6chtRSYsr0lN /Pa6rS9+Yi5r+t99s1nehpq6sK4UD6CI0IRH/WLmTK/YnqsqoXqtRRqhCievqfjPIc1fFI4Fs /16b26Vs5oeVaDHFfrDoYLrhTAUb1kLVLmmlPHOeTnYo7ikZQIFgJV3CXPaQuDcUUm+vCqVkR G7tEBkrK7/i1G2+XsQuStxepsK5E5vG/lO33LxApd3VwjYpEbxMAF8KEcUpwu7gbNPYcdGbcU Z80QpvB65W4L3Uzy Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 917 Lines: 27 On Tuesday, November 29, 2016 4:04:59 PM CET Maninder Singh wrote: > This patch fixes NULL pointer dereference when pos->file is NULL. > > caught with static analysis tool. > Signed-off-by: Maninder Singh > Signed-off-by: Vaneet Narang > --- > scripts/dtc/srcpos.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/scripts/dtc/srcpos.c b/scripts/dtc/srcpos.c > index f534c22..360fd14 100644 > --- a/scripts/dtc/srcpos.c > +++ b/scripts/dtc/srcpos.c > @@ -252,12 +252,11 @@ struct srcpos * > srcpos_dump(struct srcpos *pos) > { > printf("file : \"%s\"\n", > - pos->file ? (char *) pos->file : ""); > + pos->file ? pos->file->name : ""); > printf("first_line : %d\n", pos->first_line); > The patch looks right, but the description doesn't seem to match the bug. Arnd