Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1224552imm; Wed, 19 Sep 2018 14:28:14 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbjq144K/BQZhZANuxIr/6FLGsNCYCdfkjQvJvKeSon9vRA1Kjrsyf6+OlUqhVzubPI8t+2 X-Received: by 2002:a62:5b85:: with SMTP id p127-v6mr37898550pfb.33.1537392494196; Wed, 19 Sep 2018 14:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537392494; cv=none; d=google.com; s=arc-20160816; b=TWPd16dUQM7ZtHcOSIRzQsK7Pgle+kgLKbM7XboIn9W+4eRu6B9QGsu1+VYQCSv9wX DzVIWAvFhm67k4Zsh2sT9tl5CzFHSrOAnSYCmds/+5Eux1pOqdnrhQXOxv14l3uVCpyx Q3LoGJk9G1oFfik9rH6SiqmvRQm6g+LJtNn0eX816S9JjoPEhRscbU5ov0JVsifKEWbe I++TEpxM9jJvJeErta9TxS27Wgr3+tUbwMCDbCGYQaOngC2HV0x2F0exYd4LyTBLU8jL wnEHRg2a0NAlsu00LUTE20UaYx8+nkgaEpzkeWqdCKWm9SC+3vJswfQAWMVX/1vympcp aiJw== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=evmHmOya4yMly/bKuf3t1I8Ux+fQR9OrbxI0L8WDDT4=; b=Ckem+jwcy7LyvUTWslcUwIZWVVm0w8NMJP9XJy+3icugZYj8xNeRnyeBvUVqbFMBOx TYfE9hNHYw4EDPp6gNsJsvLqJGT03Xu1TLTItaQieuxXRFXcGswtqZCpIIqcbslByrcF WnYu5+qJAweEES2NAEZT6a4Xn/De2TifiNAzy3DAV2M/K0NVLRLFHZMghNhOJjpLu7NA IhI3YsRZRamqfSJr30EsX1IFzaH/FoyWdNlI4ZXPFJ68ITyXC2x8KGHuNICsYw27Defc 6+Kqod2IltVtqXPbrVVfpGhJGXaFKbXAyniGCqRT5jreXG8yUYqMvjvniY1TnvEcrfAS BxKQ== ARC-Authentication-Results: i=1; mx.google.com; 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 g4-v6si22543927pll.384.2018.09.19.14.27.58; Wed, 19 Sep 2018 14:28:14 -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; 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 S1732381AbeITDHg convert rfc822-to-8bit (ORCPT + 99 others); Wed, 19 Sep 2018 23:07:36 -0400 Received: from mail.bootlin.com ([62.4.15.54]:36439 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727745AbeITDHg (ORCPT ); Wed, 19 Sep 2018 23:07:36 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 5CF1120795; Wed, 19 Sep 2018 23:27:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from xps13 (unknown [91.224.148.103]) by mail.bootlin.com (Postfix) with ESMTPSA id A9BB3203DA; Wed, 19 Sep 2018 23:27:45 +0200 (CEST) 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> Organization: Bootlin X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(). > > So, we better don't take any chances and fix this by null > checking pointer *nfc_np* before calling of_clk_get(). > > 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èl