All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Thierry MERLE <thierry.merle@free.fr>,
	"Dwaine P. Garden" <dwainegarden@rogers.com>,
	Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: v4l-dvb-maintainer@linuxtv.org, linux-kernel@vger.kernel.org,
	Michal Piotrowski <michal.k.k.piotrowski@gmail.com>
Subject: [2.6.23 regression fix] usbvision: don't return an uninitialized value
Date: Mon, 23 Jul 2007 10:02:03 +0200	[thread overview]
Message-ID: <20070723080203.GD26212@stusta.de> (raw)

Commit c5f48367fe54c46805774eeea8e828de54a5ad7b introduced this return 
of an uninitialized variable.

Spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 drivers/media/video/usbvision/usbvision-video.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- linux-2.6.22-rc6-mm1/drivers/media/video/usbvision/usbvision-video.c.old	2007-07-23 01:45:01.000000000 +0200
+++ linux-2.6.22-rc6-mm1/drivers/media/video/usbvision/usbvision-video.c	2007-07-23 01:46:06.000000000 +0200
@@ -525,18 +525,17 @@ static int vidioc_s_register (struct fil
 {
 	struct video_device *dev = video_devdata(file);
 	struct usb_usbvision *usbvision =
 		(struct usb_usbvision *) video_get_drvdata(dev);
-	int errCode;
 
 	if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
 		return -EINVAL;
 	/* NT100x has a 8-bit register space */
 	reg->val = (u8)usbvision_write_reg(usbvision, reg->reg&0xff, reg->val);
 	if (reg->val < 0) {
 		err("%s: VIDIOC_DBG_S_REGISTER failed: error %d",
-		    __FUNCTION__, errCode);
-		return errCode;
+		    __FUNCTION__, reg->val);
+		return reg->val;
 	}
 	return 0;
 }
 #endif


             reply	other threads:[~2007-07-23  8:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-23  8:02 Adrian Bunk [this message]
2007-07-23 10:02 ` [v4l-dvb-maintainer] [2.6.23 regression fix] usbvision: don't return an uninitialized value Trent Piepho

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=20070723080203.GD26212@stusta.de \
    --to=bunk@stusta.de \
    --cc=dwainegarden@rogers.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=michal.k.k.piotrowski@gmail.com \
    --cc=thierry.merle@free.fr \
    --cc=v4l-dvb-maintainer@linuxtv.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.