Received: by 10.223.176.5 with SMTP id f5csp2841444wra; Mon, 5 Feb 2018 10:46:05 -0800 (PST) X-Google-Smtp-Source: AH8x226bkU0wKdMT/sW+KTksjKHnZELVLdJ6nUpozpj1y5NIOmDGcIf2xT0gt6Tz/6cM129KdFhZ X-Received: by 10.101.69.141 with SMTP id o13mr39577171pgq.204.1517856365170; Mon, 05 Feb 2018 10:46:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517856365; cv=none; d=google.com; s=arc-20160816; b=CZbko7lAzsBZYFbACId181RG4kDcK5sDt1LVceY3Ehofgw8/x6SSMee2P2T1Du2ekA /0DBZvJpDmCc91nK2RH7o/gDrR/N2515phpewviPBV4dRuEXSUBo1uwIqcREZItcxGXJ UoGvaD7QswMClNnRIbZLS5L+ysOEZe14oafnCuJDKDqHiX838LIkdiNpMCMUcmJ7zK5b dSIcGuN0/V39wkVkslJDh8Udhq5XBl4AsgJUWd/re+VxNfWcidfO6HyyNO3LwoetdjnV g4Zjs0cbmmdtPghnkbqoGAI4pg4oNRVEx7tqsAVx7/ifo2vl/IMRpZC4w4JWOY9E/quh sbjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=cQToVXdLo8hmG75JNdF1PPcnOJHcrKU4uFkt70pKcRQ=; b=fXNV7G3i347K+dtO+PfOpVC0BiXhmi+7MZm7HQqJxYXEIXRTJNuxbJBbUrPbZfjIog 4iWjHkNA/CBV1+oo48ctf4ktSTwDD+QXZAO2g1CjGZTC8PSwJGLKzTDpLjFvt40PLqZt 6kZ0/Y17L9kseinFnf8WPsD8/nHtX5bBJJwuHSpzb5uJxIqMnj13KDsm5RB1pBSbkQIO mMuVk1g4kXfg5z1FYr7mrOstrrncZHAyxsT0rKDovevfhCZXpzykiR9F5kdHhkBSCxdV gQTB1AnjJbFWt8QbvIEHvp7xoZTLBFOU9yxwBADStIH7w09FJRpwh1kytJ7+rDhOHM1I NgCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=HWWZS6Yl; 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 z65si116846pgd.688.2018.02.05.10.45.50; Mon, 05 Feb 2018 10:46:05 -0800 (PST) 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; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=HWWZS6Yl; 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 S1753771AbeBESoT (ORCPT + 99 others); Mon, 5 Feb 2018 13:44:19 -0500 Received: from mail-oi0-f67.google.com ([209.85.218.67]:46717 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753975AbeBESoI (ORCPT ); Mon, 5 Feb 2018 13:44:08 -0500 Received: by mail-oi0-f67.google.com with SMTP id x21so8842669oie.13 for ; Mon, 05 Feb 2018 10:44:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=cQToVXdLo8hmG75JNdF1PPcnOJHcrKU4uFkt70pKcRQ=; b=HWWZS6YlQWYVdqBMHE8GqZTwQS/WkiIsrmucB6YIkb5AyLLmpurve3KfGguKiuHriQ VfmKw7s8P+B+mH1MQ38JOv+egp1jVo4Gp0jwjI4/ZW8g24Y+Qp20+OoU9rb1v/Bnjp4i yuJrVEXMPGbEyigbpXsGqS6NpT4s9cbzfpMW/LBx0kYp4uhmQgRN0xwvqgB4mIWU54pW xfEE6eIfkv6M2xBkD+8K8hlhsKYfnOAqk2sZWqvjt5KPxoCE2/cmi8nhxo2fTFlRuHlb Xb9aQOckQMoXMQjmwlwkd+JVGqkdmOIFTeUJ993JqvLoet9zDlXbK6+NKcgZhqYgquAD YElQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=cQToVXdLo8hmG75JNdF1PPcnOJHcrKU4uFkt70pKcRQ=; b=WmiajwNnv//bvEizzQ2M2WimsPwzmVfRfRL/jPoDo7vD2X1k9VJEw6zrnrrADBZ5de oSWhy8aHnFZXtN1VebgxfrJsTTC23qLWNaQC4MBiLa2THit7bg39UPm/NbbH0j0NXMWF BmpicimGXXbpXXAjyuT8nNbBV5oOGPAgkOt4iW18Neo+nPstrpAtEtOyADQ2gLAyaXRr EWSLKzTCqevtZukDoTdNyFebwqbBIJOQ/63Xa5wGEz0dUcI0bG5ANvdTU/UeERobQDWF FBejI8Y7Cqa5Y1xJL2hKQIOm0kdSBO26zaPOS/S7ThlxTDbAnWJeezYX1avvlgxobvYE wJoQ== X-Gm-Message-State: AKwxytc4AsPDqikQ8ayQypuiZ2muC4iXGhq0bBZicKylyve6+luWE/W7 fvC2qE7iTxk8YNg1Nd18bDs1fmwQmlydHOQraiCu1w== X-Received: by 10.202.198.136 with SMTP id w130mr22339966oif.314.1517856247676; Mon, 05 Feb 2018 10:44:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.62.91 with HTTP; Mon, 5 Feb 2018 10:44:07 -0800 (PST) In-Reply-To: <20180205182039.GA7891@linux.intel.com> References: <20180205140852.14110-1-colin.king@canonical.com> <20180205182039.GA7891@linux.intel.com> From: Dan Williams Date: Mon, 5 Feb 2018 10:44:07 -0800 Message-ID: Subject: Re: [PATCH] libnvdimm: remove redundant assignment to pointer 'dev' To: Ross Zwisler Cc: Colin King , linux-nvdimm@lists.01.org, kernel-janitors@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 5, 2018 at 10:20 AM, Ross Zwisler wrote: > On Mon, Feb 05, 2018 at 02:08:52PM +0000, Colin King wrote: >> From: Colin Ian King >> >> Pointer dev is being assigned a value that is never read, it is being >> re-assigned the same value later on, hence the initialization is redundant >> and can be removed. >> >> Cleans up clang warning: >> drivers/nvdimm/pfn_devs.c:307:17: warning: Value stored to 'dev' during >> its initialization is never read >> >> Signed-off-by: Colin Ian King > > Reviewed-by: Ross Zwisler > > More importantly this fixes a potential NULL pointer dereference. nd_pfn > is checked for NULL a few lines down, but we would have crashed here trying to > get nd_pfn->dev. > No we wouldn't crash. We're just calculating the address, not de-referencing a NULL pointer.