Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1919607ybm; Thu, 23 May 2019 08:37:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxehr0ytqzjCwQvOldfsWLax/jC9G8GZ1fN8CWrsdy4M2KJDNth9El3BvsPWptYdn2PDWvS X-Received: by 2002:a17:90a:c583:: with SMTP id l3mr1957736pjt.55.1558625849308; Thu, 23 May 2019 08:37:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558625849; cv=none; d=google.com; s=arc-20160816; b=pe94riThlYE7CI79ju0p28nQixX8gEICCJHtD9C18MB7ps9nxLINS9DD3PznB9DYLw P8yV8wEZc3mX9uZSJMN5Jthp3RhgnzRFcGIZYQFfVTILsjePVpYwNEutvIqmbKXczNb9 voS91DRuFi/Wz0IzJ/SuucqvYOKvuqGnKNHUfK4cM9M31UB4VLMkguancpGFcnLJggFX 9iIimfN/m3J1/7aNV9yxuwnGTlKMmQMvAIzuUJfoXm1rjHWno85/CrLd6003l3Qk04LY gGTW4xtfmZURdA4OxHN3qcI+yNpv7/THuq+rEccJuJieG96o6A79VQWdYNUubsvSb9mi yNdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=u7LRGUAkc7MmENWtPTnGBlH4AqK0GL/jUqDDtZhAKtY=; b=r+jYM7hYl53YAfhPwIdO6w4QfhrDQwgPUDKTnEV2znDcbJpUeSKzI6uGfKIbBaIbYQ COI1dVN6c2nB2RVEP7BTUG1Zn8VUxoTD/KBG82cuO3rnroJ4lEkREpMA0wbn4U1r007N kxHMTo4Eof9EPY1zZBNaqlDsP9rjVsxLDyhddl2grAD1u+iaR1RWAsy3dWz3xw1HlP45 wW6wySI/ZOlo6V+/GigUXpx5i6hHMwfSZnfxwNsrJJMW95agWtjO0m+uegF5ltDZlo8P UmFBvzHEqYu53W9Yx7chtSlB+rZPwDQLbTDkgRDpVBUENVT9QMOoP2mBze6Qu4QqQjh2 u6yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hkLe4JMm; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r185si29806816pgr.10.2019.05.23.08.37.11; Thu, 23 May 2019 08:37:29 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hkLe4JMm; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731086AbfEWPfx (ORCPT + 99 others); Thu, 23 May 2019 11:35:53 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:36422 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730866AbfEWPfx (ORCPT ); Thu, 23 May 2019 11:35:53 -0400 Received: by mail-ed1-f66.google.com with SMTP id a8so9851491edx.3; Thu, 23 May 2019 08:35:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=u7LRGUAkc7MmENWtPTnGBlH4AqK0GL/jUqDDtZhAKtY=; b=hkLe4JMmxf0dcgTvJtjxIAYwmwWavbwwRoIPkmLlqnh2eTIKFOcvLi4cgcphOplATt POTcp28T3R8sosv4sem6hFp1nsu86K7mb0NLEno1CtbIYorggPaSWfSHaNvDQ5lcb9h1 quewMMnxmno5KjR/Wvrh8IXKXf78dzrUgH//sYNEUImyy+hUgOG+SYx0Z+VVMr1PJxK8 3c5badxV6idEMF2w8hx3oomth6R2Pd4UyEz2Hy4Jd3KuqKwcAJeHcZQX3s3+cQOys5tY IH4C0IqpRDifzFLYE3mBWv+K8X14840gPwP9A0YTV2O9Zq4dQ8RBpZv4UmvjCrm+RNh3 MPxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=u7LRGUAkc7MmENWtPTnGBlH4AqK0GL/jUqDDtZhAKtY=; b=XNOOvaBOI379vftmpCgM5qT2AXsHQVjP4sJF84tMvYYsSwMXlletG+xmTJif9rC7IV 7AMcRsARMq9yeC692X0FKx2uqar6gX/VYWrWh+J/A3/DSorfmxAaq/w/7NSx2jg7VN6T 6bQNw2DHe9k/VNgf7wm6WdLEjKNQ/NYqd0kohpRrhWut8bs9pox/XFyiIkHE6zgaNVTq pzlIbrnh73sz5FGo94AaMnEYj+mv09xuZUtAhgwfrQJKDe0+A6/GjIVGKx2OIWBBpR4Q r8aZLbmzHWTQoK502nOtsLQIoZye9JbVQZslQPp2Zoz482TnuOtYy1n30n999SEdzBqj pwgQ== X-Gm-Message-State: APjAAAU8aKyILRmHjDxTsDoulYh64P5ztYxvLeMRTlrutB0taMrc+5F3 DDsZmfKCMD8tXFIeN5n/a3o= X-Received: by 2002:a17:906:265b:: with SMTP id i27mr35933745ejc.147.1558625751135; Thu, 23 May 2019 08:35:51 -0700 (PDT) Received: from archlinux-epyc ([2a01:4f9:2b:2b15::2]) by smtp.gmail.com with ESMTPSA id z32sm7942897edz.85.2019.05.23.08.35.49 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 23 May 2019 08:35:50 -0700 (PDT) Date: Thu, 23 May 2019 08:35:48 -0700 From: Nathan Chancellor To: Colin King Cc: Don Brace , "James E . J . Bottomley" , "Martin K . Petersen" , esc.storagedev@microsemi.com, linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][next] scsi: hpsa: fix an uninitialized read and dereference of pointer dev Message-ID: <20190523153548.GA112363@archlinux-epyc> References: <20190522083903.18849-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190522083903.18849-1-colin.king@canonical.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 22, 2019 at 09:39:03AM +0100, Colin King wrote: > From: Colin Ian King > > Currently the check for a lockup_detected failure exits via the > label return_reset_status that reads and dereferences an uninitialized > pointer dev. Fix this by ensuring dev is inintialized to null. > > Addresses-Coverity: ("Uninitialized pointer read") > Fixes: 14991a5bade5 ("scsi: hpsa: correct device resets") > Signed-off-by: Colin Ian King Reviewed-by: Nathan Chancellor Clang similarly warns about this, hence my identical submission after this, sorry for the noise. > --- > drivers/scsi/hpsa.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c > index c560a4532733..ac8338b0571b 100644 > --- a/drivers/scsi/hpsa.c > +++ b/drivers/scsi/hpsa.c > @@ -5947,7 +5947,7 @@ static int hpsa_eh_device_reset_handler(struct scsi_cmnd *scsicmd) > int rc = SUCCESS; > int i; > struct ctlr_info *h; > - struct hpsa_scsi_dev_t *dev; > + struct hpsa_scsi_dev_t *dev = NULL; > u8 reset_type; > char msg[48]; > unsigned long flags; > -- > 2.20.1 >