* re: ufs: Add regulator enable support
@ 2014-10-02 15:25 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2014-10-02 15:25 UTC (permalink / raw)
To: sthumma; +Cc: linux-scsi
Hello Sujit Reddy Thumma,
The patch aa4976130934: "ufs: Add regulator enable support" from Sep
25, 2014, leads to the following static checker warning:
drivers/scsi/ufs/ufshcd-pltfrm.c:167 ufshcd_populate_vreg()
warn: missing error code here? 'devm_kzalloc()' failed. 'ret' = '0'
drivers/scsi/ufs/ufshcd-pltfrm.c
144 static int ufshcd_populate_vreg(struct device *dev, const char *name,
145 struct ufs_vreg **out_vreg)
146 {
147 int ret = 0;
148 char prop_name[MAX_PROP_SIZE];
149 struct ufs_vreg *vreg = NULL;
150 struct device_node *np = dev->of_node;
151
152 if (!np) {
153 dev_err(dev, "%s: non DT initialization\n", __func__);
154 goto out;
155 }
156
157 snprintf(prop_name, MAX_PROP_SIZE, "%s-supply", name);
158 if (!of_parse_phandle(np, prop_name, 0)) {
159 dev_info(dev, "%s: Unable to find %s regulator, assuming enabled\n",
160 __func__, prop_name);
161 goto out;
162 }
163
164 vreg = devm_kzalloc(dev, sizeof(*vreg), GFP_KERNEL);
165 if (!vreg) {
166 dev_err(dev, "No memory for %s regulator\n", name);
167 goto out;
Don't print an error message.
Don't use a goto out.
Don't forget to set an error code.
168 }
169
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-10-02 15:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-02 15:25 ufs: Add regulator enable support Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox