Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1925179yba; Fri, 10 May 2019 03:28:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqz0hp/ssOEsLfo0xuHiYmeGCpFXq7Z2DFATuI55q/VpnI7nvd5816XmYV4tMr6VpyKtXFet X-Received: by 2002:a62:1897:: with SMTP id 145mr13012556pfy.122.1557484135440; Fri, 10 May 2019 03:28:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557484135; cv=none; d=google.com; s=arc-20160816; b=PeQev6mJ8bUzgLy4kFgCXWkbeezt5bSaYTjkR5UUsNsuFXp8Qkz7ApD+0CTdVudX52 WwWHvJnZulLLCwS/79Z8NFvFMr3ZfVprf+fVPa7rl6jo0rlV68zPqaOCl8laNAaKR/Ra zHrPAUuuXTDodupO85tCXbUjro8/cczKfG7Pm5S1oN2vUw6PKkx95Ei3rXh9qkqLkv1C Jwb3PX6H6hfYksGGvhT5TiiDABJmdAGKiLaDz0yRA2TQ1AFY3KJ1sF/LwsPoU6/95edl nmOfgRJYicwKSPgQ1mvhn1jkAXcyw5ujO49pBEg9OkX5bUX9+g2NcrkMUcOTNxhVZkK3 n6WQ== 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 :references:in-reply-to:date:cc:to:from:subject:message-id; bh=GQMDx6cOrP0jukVln98+E6jX7uhJf3GCptL2hOT0yI4=; b=wfggNeweiejlfa7bNdCoAZQkZPYk3irc95sc9hDUoWsVAqOF5EORUrBPO+ec2h09w3 h2Addz9qJ+pFNnE+rt2DE4E+PxPfEX8h20AXnhJjXYUz0He/z4NmcqRJpm8OEAlOdaAw gHMfycjPBNrMma0EponIQ7vLAUbn8szTI23cawSjv7iKmzltY9lg7FyGfrnaMCxrsqzJ ayVx9wP4dd5yWxOgLQ7/GkHvPiYKtcOpYkKVHe8iptFRe3MfbT9arN0Kgb9xq9r7rJyr xZzY0AmLHmfykWi8KC+74wywwE8hyVeP8f2Z/2lPZbAw72RFrdU/FctjO4FB46i9LE1F kWAQ== 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 t1si4114298plr.74.2019.05.10.03.28.37; Fri, 10 May 2019 03:28:55 -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 S1727528AbfEJKZ3 (ORCPT + 99 others); Fri, 10 May 2019 06:25:29 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:38135 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727425AbfEJKZ3 (ORCPT ); Fri, 10 May 2019 06:25:29 -0400 Received: from lupine.hi.pengutronix.de ([2001:67c:670:100:3ad5:47ff:feaf:1a17] helo=lupine) by metis.ext.pengutronix.de with esmtp (Exim 4.89) (envelope-from ) id 1hP2iV-0001HQ-Pr; Fri, 10 May 2019 12:25:27 +0200 Message-ID: <1557483927.7859.3.camel@pengutronix.de> Subject: Re: [PATCH][V2] reset: remove redundant null check on pointer dev From: Philipp Zabel To: Bartosz Golaszewski , Colin King Cc: kernel-janitors@vger.kernel.org, LKML Date: Fri, 10 May 2019 12:25:27 +0200 In-Reply-To: References: <20190510095832.28233-1-colin.king@canonical.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:3ad5:47ff:feaf:1a17 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2019-05-10 at 12:14 +0200, Bartosz Golaszewski wrote: > pt., 10 maj 2019 o 11:58 Colin King napisaƂ(a): > > > > From: Colin Ian King > > > > Pointer dev is being dereferenced when passed to the inlined > > functon dev_name, however, dev is later being null checked > > so at first this seems like a potential null pointer dereference. > > > > In fact, _reset_control_get_from_lookup is only ever called from > > __reset_control_get, right after checking dev->of_node hence > > dev can never be null. Clean this up by removing the redundant > > null check. > > > > Thanks to Philipp Zabel for spotting that dev can never be null. > > > > Addresses-Coverity: ("Dereference before null check") > > Fixes: 6691dffab0ab ("reset: add support for non-DT systems") > > Signed-off-by: Colin Ian King [...] > Reviewed-by: Bartosz Golaszewski Thank you both, applied to reset/fixes. regards Philipp