From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Wed, 19 Sep 2018 23:27:45 +0200 From: Miquel Raynal To: "Gustavo A. R. Silva" Cc: Tudor Ambarus , Boris Brezillon , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mtd: rawnand: atmel: Fix potential NULL pointer dereference Message-ID: <20180919232745.4ed2197c@xps13> In-Reply-To: <20180918135555.GA18114@embeddedor.com> References: <20180918135555.GA18114@embeddedor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Hi Gustavo, "Gustavo A. R. Silva" wrote on Tue, 18 Sep 2018 08:55:55 -0500: > There is a potential execution path in which function > of_find_compatible_node() returns NULL. In such a case, > we end up having a NULL pointer dereference when accessing > pointer *nfc_np* in function of_clk_get(). >=20 > So, we better don't take any chances and fix this by null > checking pointer *nfc_np* before calling of_clk_get(). >=20 > Addresses-Coverity-ID: 1473052 ("Dereference null return value") > Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver") > Signed-off-by: Gustavo A. R. Silva > --- Applied to nand/next. Thanks, Miqu=C3=A8l