diff options
author | David Binder <david.binder@unisys.com> | 2016-05-06 13:11:23 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-05-09 14:15:18 +0200 |
commit | 3b5e11d7f566495f7ff3f4178b814a59b4ea84a5 (patch) | |
tree | bd3a2d3f156208b34758b27965431e2b0f431f94 /drivers/staging | |
parent | 825157aedabc2b4c0cb3152012b00ea0bdcd6fac (diff) |
staging: unisys: visorhba: switch success handling to error handling
Addresses code audit feeback to switch from success handling to error
handling in visorhba_main.c/process_disk_notify().
Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/unisys/visorhba/visorhba_main.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c b/drivers/staging/unisys/visorhba/visorhba_main.c index 7a2c48943b84..6a4570d10642 100644 --- a/drivers/staging/unisys/visorhba/visorhba_main.c +++ b/drivers/staging/unisys/visorhba/visorhba_main.c @@ -950,14 +950,15 @@ static void process_disk_notify(struct Scsi_Host *shost, struct diskaddremove *dar; dar = kzalloc(sizeof(*dar), GFP_ATOMIC); - if (dar) { - dar->add = cmdrsp->disknotify.add; - dar->shost = shost; - dar->channel = cmdrsp->disknotify.channel; - dar->id = cmdrsp->disknotify.id; - dar->lun = cmdrsp->disknotify.lun; - queue_disk_add_remove(dar); - } + if (!dar) + return; + + dar->add = cmdrsp->disknotify.add; + dar->shost = shost; + dar->channel = cmdrsp->disknotify.channel; + dar->id = cmdrsp->disknotify.id; + dar->lun = cmdrsp->disknotify.lun; + queue_disk_add_remove(dar); } /** |