Skip to content

Commit

Permalink
scsi: cxlflash: Adapter context init can return error
Browse files Browse the repository at this point in the history
Adapter context creation can return either NULL or an error pointer.
Updating the check condition to reflect this.

Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Uma Krishnan authored and Martin K. Petersen committed Jan 11, 2018
1 parent 8762353 commit 0df69c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/cxlflash/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1992,7 +1992,7 @@ static int init_mc(struct cxlflash_cfg *cfg, u32 index)
ctx = cxl_get_context(cfg->dev);
else
ctx = cxl_dev_context_init(cfg->dev);
if (unlikely(!ctx)) {
if (IS_ERR_OR_NULL(ctx)) {
rc = -ENOMEM;
goto err1;
}
Expand Down

0 comments on commit 0df69c6

Please sign in to comment.