提交 758581b9 编写于 作者: D Dolev Raviv 提交者: Christoph Hellwig

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: NDolev Raviv <draviv@codeaurora.org>
Reviewed-by: NMaya Erez <merez@codeaurora.org>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
上级 233b594b
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册