Received: by 10.223.176.5 with SMTP id f5csp2945411wra; Mon, 5 Feb 2018 12:49:01 -0800 (PST) X-Google-Smtp-Source: AH8x227dTyeP0+vWwd9+Jb36RxdBwIzxo0keTStJmjNYA8N4kT9hVSa1WKVZRPURCgXp/+zFsgFc X-Received: by 10.98.196.13 with SMTP id y13mr71372pff.73.1517863741151; Mon, 05 Feb 2018 12:49:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517863741; cv=none; d=google.com; s=arc-20160816; b=iSN9DgbYD4Vta/ImMoqj6dBLofr7yDha5eUZl/bkxZp9MjkXmhcSbHwgNszczvQ9cA 8Bupk6MG0Zh0uIum56dFYhVb8PRT7KePHB6FetZojcuD9iMCEwOY8T+Lvu2RJGEX5QlQ ApVzBU2YcLDFj4VowOT5fuUNOLHXKpA99lfivVRmHYw51aj/vVmaQgzdkADuT7mluQ5t 5nlsm1oq3Ud5stPPyEXy+IX1P3W0rEohlwX9Hj8Y+do6AfE7Br4GLoxdAshzf0Omk7o8 eUIaVXBCEMf1Ot67vtpOZowy8bT5WPJs8/xnYB1R7AicYRTU+KjTAHRj2bx6gsAT6p2I ADmw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=jSvPjXSowxJCHTcFkHWOrfEVLu2ylQogDQszsqLsbS4=; b=d+nBsQ0wS7N0jyIoz3ZMlLSJdqip6EM+UQD/8t050e2/QEHeyfw8JolspS+sEWW1O0 FUfN2w5Zll+Cfol12f53NDljKMlisQ7fQAoli4SR0bpYQjkxg9W5rf2Kf/tSMvbJlGkN 6op3q5hBAJYToKx2FF5TCXS/IzcT4yJoVLveHXW8QvwKW51v7ZZ6PnzfNkIxl0sRehqI iNKPuKeGBY9duHC0SUfAoJ5MMoIzuXB7rnd/CcJOfYpZ9za4hwnFyD9qzLGP526vIA5v SVVSXU79/A5W8cniqnnJz9iyj0XpRcTmdPvuW5UfixFrbmu3goclmtdKMesoEyIkcU51 4QFw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h9-v6si439091pls.823.2018.02.05.12.48.46; Mon, 05 Feb 2018 12:49:01 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751986AbeBEUq6 (ORCPT + 99 others); Mon, 5 Feb 2018 15:46:58 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:60438 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751617AbeBEUqv (ORCPT ); Mon, 5 Feb 2018 15:46:51 -0500 Received: from 1.general.cking.uk.vpn ([10.172.193.212]) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1einf6-0004fQ-AB; Mon, 05 Feb 2018 20:46:48 +0000 Subject: Re: [PATCH] libnvdimm: remove redundant assignment to pointer 'dev' To: Dan Williams , Ross Zwisler Cc: linux-nvdimm@lists.01.org, kernel-janitors@vger.kernel.org, Linux Kernel Mailing List References: <20180205140852.14110-1-colin.king@canonical.com> <20180205182039.GA7891@linux.intel.com> From: Colin Ian King Message-ID: <22ac2ac7-f75f-3cd0-30d7-8cfe7605c8fb@canonical.com> Date: Mon, 5 Feb 2018 20:46:47 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/02/18 18:44, Dan Williams wrote: > 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. Indeed, it's just a warning clean up. Nothing more. > -- > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >