]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
scsi: ufs: fix static checker warning in ufshcd_populate_vreg
authorDolev Raviv <draviv@codeaurora.org>
Thu, 23 Oct 2014 10:25:15 +0000 (13:25 +0300)
committerChristoph Hellwig <hch@lst.de>
Thu, 20 Nov 2014 16:47:41 +0000 (17:47 +0100)
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>
drivers/scsi/ufs/ufshcd-pltfrm.c

index 8adf067ff019344eaf0c42b97007b4abac65e79e..2cdec7847e73bf24592b0d670f968edcd474fe1d 100644 (file)
@@ -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);