From: Adrian Bunk <bunk@stusta.de>
To: linux-kernel@vger.kernel.org
Subject: [2.6 patch] sound/oss/rme96xx.c: fix two check after use
Date: Sun, 27 Mar 2005 23:17:28 +0200 [thread overview]
Message-ID: <20050327211728.GF4285@stusta.de> (raw)
This patch fixes two check after use found by the Coverity checker.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
--- linux-2.6.12-rc1-mm3-full/sound/oss/rme96xx.c.old 2005-03-27 23:16:02.000000000 +0200
+++ linux-2.6.12-rc1-mm3-full/sound/oss/rme96xx.c 2005-03-27 23:16:11.000000000 +0200
@@ -1534,18 +1534,20 @@
static ssize_t rme96xx_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
{
struct dmabuf *dma = (struct dmabuf *)file->private_data;
ssize_t ret = 0;
int cnt; /* number of bytes from "buffer" that will/can be used */
- int hop = count/dma->outchannels;
+ int hop;
int hwp;
int exact = (file->f_flags & O_NONBLOCK);
if(dma == NULL || (dma->s) == NULL)
return -ENXIO;
+ hop = count/dma->outchannels;
+
if (dma->mmapped || !dma->opened)
return -ENXIO;
if (!access_ok(VERIFY_READ, buffer, count))
return -EFAULT;
@@ -1599,18 +1601,20 @@
static ssize_t rme96xx_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
{
struct dmabuf *dma = (struct dmabuf *)file->private_data;
ssize_t ret = 0;
int cnt; /* number of bytes from "buffer" that will/can be used */
- int hop = count/dma->inchannels;
+ int hop;
int hwp;
int exact = (file->f_flags & O_NONBLOCK);
if(dma == NULL || (dma->s) == NULL)
return -ENXIO;
+ hop = count/dma->inchannels;
+
if (dma->mmapped || !dma->opened)
return -ENXIO;
if (!access_ok(VERIFY_WRITE, buffer, count))
return -EFAULT;
next reply other threads:[~2005-03-27 21:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-27 21:17 Adrian Bunk [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-04-13 2:17 [2.6 patch] sound/oss/rme96xx.c: fix two check after use Adrian Bunk
2005-04-13 3:03 ` Al Viro
[not found] <3SGgN-41r-1@gated-at.bofh.it>
[not found] ` <3SGA8-4n3-9@gated-at.bofh.it>
2005-04-13 10:40 ` Bodo Eggert <harvested.in.lkml@posting.7eggert.dyndns.org>
2005-04-13 14:58 ` Christoph Hellwig
2005-04-13 17:46 ` Al Viro
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=20050327211728.GF4285@stusta.de \
--to=bunk@stusta.de \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox