lkml.org 
[lkml]   [2020]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] cxlflash: remove an unnecessary NULL check
The "cmd" pointer was already dereferenced a couple lines earlier so
this NULL check is too late. Fortunately, the pointer can never be NULL
and the check can be removed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/scsi/cxlflash/main.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c
index fcc5aa9f60147..94250ebe9e803 100644
--- a/drivers/scsi/cxlflash/main.c
+++ b/drivers/scsi/cxlflash/main.c
@@ -47,9 +47,6 @@ static void process_cmd_err(struct afu_cmd *cmd, struct scsi_cmnd *scp)
struct sisl_ioasa *ioasa;
u32 resid;

- if (unlikely(!cmd))
- return;
-
ioasa = &(cmd->sa);

if (ioasa->rc.flags & SISL_RC_FLAGS_UNDERRUN) {
--
2.26.2
\
 
 \ /
  Last update: 2020-06-05 13:07    [W:0.039 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site