All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: David Airlie <airlied@linux.ie>
Cc: kernel-janitors@vger.kernel.org, Ben Skeggs <bskeggs@redhat.com>,
	dri-devel@lists.freedesktop.org
Subject: [patch] drm/nva3: checking the wrong variable
Date: Tue, 11 Oct 2011 14:34:53 +0000	[thread overview]
Message-ID: <20111011143453.GA29096@elgon.mountain> (raw)

"id" is unsigned here and it's never less than zero.  I believe the
intent was to check the return value from nva3_pm_pll_offset().
Also I've changed it to pass on the -ENOENT error code from the lower
levels instead of returning -EINVAL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/nouveau/nva3_pm.c b/drivers/gpu/drm/nouveau/nva3_pm.c
index e4b2b9e..0be517d 100644
--- a/drivers/gpu/drm/nouveau/nva3_pm.c
+++ b/drivers/gpu/drm/nouveau/nva3_pm.c
@@ -112,8 +112,8 @@ nva3_pm_clock_pre(struct drm_device *dev, struct nouveau_pm_level *perflvl,
 		return (ret = -ENOENT) ? NULL : ERR_PTR(ret);
 
 	off = nva3_pm_pll_offset(id);
-	if (id < 0)
-		return ERR_PTR(-EINVAL);
+	if (off < 0)
+		return ERR_PTR(off);
 
 
 	pll = kzalloc(sizeof(*pll), GFP_KERNEL);

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: David Airlie <airlied@linux.ie>
Cc: kernel-janitors@vger.kernel.org, Ben Skeggs <bskeggs@redhat.com>,
	dri-devel@lists.freedesktop.org
Subject: [patch] drm/nva3: checking the wrong variable
Date: Tue, 11 Oct 2011 17:34:53 +0300	[thread overview]
Message-ID: <20111011143453.GA29096@elgon.mountain> (raw)

"id" is unsigned here and it's never less than zero.  I believe the
intent was to check the return value from nva3_pm_pll_offset().
Also I've changed it to pass on the -ENOENT error code from the lower
levels instead of returning -EINVAL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/nouveau/nva3_pm.c b/drivers/gpu/drm/nouveau/nva3_pm.c
index e4b2b9e..0be517d 100644
--- a/drivers/gpu/drm/nouveau/nva3_pm.c
+++ b/drivers/gpu/drm/nouveau/nva3_pm.c
@@ -112,8 +112,8 @@ nva3_pm_clock_pre(struct drm_device *dev, struct nouveau_pm_level *perflvl,
 		return (ret == -ENOENT) ? NULL : ERR_PTR(ret);
 
 	off = nva3_pm_pll_offset(id);
-	if (id < 0)
-		return ERR_PTR(-EINVAL);
+	if (off < 0)
+		return ERR_PTR(off);
 
 
 	pll = kzalloc(sizeof(*pll), GFP_KERNEL);

             reply	other threads:[~2011-10-11 14:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-11 14:34 Dan Carpenter [this message]
2011-10-11 14:34 ` [patch] drm/nva3: checking the wrong variable Dan Carpenter
2011-10-11 22:26 ` Ben Skeggs
2011-10-11 22:26   ` Ben Skeggs

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=20111011143453.GA29096@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=airlied@linux.ie \
    --cc=bskeggs@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-janitors@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.