Skip to content

Commit

Permalink
scsi: ufs: fix static checker warning in ufshcd_populate_vreg
Browse files Browse the repository at this point in the history
This patch fixes newly introduced static checker warning in
ufshcd_populate_vreg, introduced by UFS power management series.

Warning:
drivers/scsi/ufs/ufshcd-pltfrm.c:167 ufshcd_populate_vreg()
warn: missing error code here? 'devm_kzalloc()' failed. 'ret' = '0'

To fix it we return -ENOMEM and skip the message print.

Signed-off-by: Dolev Raviv <draviv@codeaurora.org>
Reviewed-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Dolev Raviv authored and Christoph Hellwig committed Nov 20, 2014
1 parent 233b594 commit 758581b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/scsi/ufs/ufshcd-pltfrm.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,8 @@ static int ufshcd_populate_vreg(struct device *dev, const char *name,
}

vreg = devm_kzalloc(dev, sizeof(*vreg), GFP_KERNEL);
if (!vreg) {
dev_err(dev, "No memory for %s regulator\n", name);
goto out;
}
if (!vreg)
return -ENOMEM;

vreg->name = kstrdup(name, GFP_KERNEL);

Expand Down

0 comments on commit 758581b

Please sign in to comment.