diff options
author | Dolev Raviv <draviv@codeaurora.org> | 2014-10-23 12:25:15 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-20 17:47:41 +0100 |
commit | 758581b929ce50ae3a5cf80735e3e58ef45c31b5 (patch) | |
tree | 969ec0edd06694ffae32cd142c64cb3804d5db90 /drivers | |
parent | scsi: ufs: fix static checker errors in ufshcd_system_suspend (diff) | |
download | linux-758581b929ce50ae3a5cf80735e3e58ef45c31b5.tar.xz linux-758581b929ce50ae3a5cf80735e3e58ef45c31b5.zip |
scsi: ufs: fix static checker warning in ufshcd_populate_vreg
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/ufs/ufshcd-pltfrm.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/drivers/scsi/ufs/ufshcd-pltfrm.c index 8adf067ff019..2cdec7847e73 100644 --- a/drivers/scsi/ufs/ufshcd-pltfrm.c +++ b/drivers/scsi/ufs/ufshcd-pltfrm.c @@ -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); |