Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753426AbdCOQqf (ORCPT ); Wed, 15 Mar 2017 12:46:35 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:60935 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753349AbdCOQqe (ORCPT ); Wed, 15 Mar 2017 12:46:34 -0400 From: Colin King To: Bradley Grove , "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] [SCSI] esas2r: remove redundant NULL check on buffer Date: Wed, 15 Mar 2017 16:46:24 +0000 Message-Id: <20170315164624.17264-1-colin.king@canonical.com> X-Mailer: git-send-email 2.10.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 841 Lines: 30 From: Colin Ian King 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 --- 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); /* -- 2.10.2