public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Dolev Raviv <draviv@codeaurora.org>
To: James.Bottomley@HansenPartnership.com, hch@infradead.org
Cc: linux-scsi@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	santoshsy@gmail.com, Dolev Raviv <draviv@codeaurora.org>
Subject: [PATCH 4/6] scsi: ufs: fix static checker warning in ufshcd_populate_vreg
Date: Thu, 23 Oct 2014 13:25:15 +0300	[thread overview]
Message-ID: <1414059917-13831-5-git-send-email-draviv@codeaurora.org> (raw)
In-Reply-To: <1414059917-13831-1-git-send-email-draviv@codeaurora.org>

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>

diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/drivers/scsi/ufs/ufshcd-pltfrm.c
index 8adf067..2cdec78 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);
 
-- 
1.8.5.2
-- 
Qualcomm Israel, on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

  parent reply	other threads:[~2014-10-23 10:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-23 10:25 [PATCH 0/6] various fixes for UFS-PM series Dolev Raviv
2014-10-23 10:25 ` [PATCH 1/6] scsi: ufs: fix reference counting of W-LUs Dolev Raviv
2014-10-23 10:25 ` [PATCH 2/6] scsi: ufs: fix power info after link start-up Dolev Raviv
2014-10-23 10:25 ` [PATCH 3/6] scsi: ufs: fix static checker errors in ufshcd_system_suspend Dolev Raviv
2014-10-23 10:25 ` Dolev Raviv [this message]
2014-10-23 10:25 ` [PATCH 5/6] scsi: ufs: fix static checker warning in __ufshcd_setup_clocks Dolev Raviv
2014-10-23 10:25 ` [PATCH 6/6] scsi: ufs: fix static checker warning in ufshcd_parse_clock_info Dolev Raviv
2014-10-23 17:15 ` [PATCH 0/6] various fixes for UFS-PM series Christoph Hellwig
2014-10-24  7:53   ` Dolev Raviv
2014-10-24  9:22     ` Christoph Hellwig
2014-10-26 11:04       ` Dolev Raviv
2014-10-27  9:50         ` Christoph Hellwig
2014-11-20 11:19           ` Dolev Raviv
2014-11-20 11:42 ` merez
2014-11-20 16:48 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1414059917-13831-5-git-send-email-draviv@codeaurora.org \
    --to=draviv@codeaurora.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=hch@infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=santoshsy@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox