From: Bradley Grove <bgrove@attotech.com>
To: Colin King <colin.king@canonical.com>,
"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [SCSI] esas2r: remove redundant NULL check on buffer
Date: Thu, 16 Mar 2017 17:09:35 -0400 [thread overview]
Message-ID: <c304f4f4-8e4a-f716-ecd0-7f3ff7980dbc@attotech.com> (raw)
In-Reply-To: <20170315164624.17264-1-colin.king@canonical.com>
On 03/15/2017 12:46 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> buffer is a pointer to the static char array event_buffer and
> therefore can never be null, so the check is redundant. Remove it.
>
> Detected by CoverityScan, CID#1077556 ("Logically Dead Code")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/scsi/esas2r/esas2r_log.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/drivers/scsi/esas2r/esas2r_log.c b/drivers/scsi/esas2r/esas2r_log.c
> index a82030a..65fdf22 100644
> --- a/drivers/scsi/esas2r/esas2r_log.c
> +++ b/drivers/scsi/esas2r/esas2r_log.c
> @@ -130,11 +130,6 @@ static int esas2r_log_master(const long level,
>
> spin_lock_irqsave(&event_buffer_lock, flags);
>
> - if (buffer == NULL) {
> - spin_unlock_irqrestore(&event_buffer_lock, flags);
> - return -1;
> - }
> -
> memset(buffer, 0, buflen);
>
> /*
>
Thanks,
Acked-by: Bradley Grove <bgrove@attotech.com>
This electronic transmission and any attachments hereto are intended only for the use of the individual or entity to which it is addressed and may contain confidential information belonging to ATTO Technology, Inc. If you have reason to believe that you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on the contents of this electronic transmission is strictly prohibited. If you have reason to believe that you have received this transmission in error, please notify ATTO immediately by return e-mail and delete and destroy this communication.
next prev parent reply other threads:[~2017-03-16 22:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-15 16:46 Colin King
2017-03-16 21:09 ` Bradley Grove [this message]
2017-03-16 23:50 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c304f4f4-8e4a-f716-ecd0-7f3ff7980dbc@attotech.com \
--to=bgrove@attotech.com \
--cc=colin.king@canonical.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®