* [2.6 patch] sound/oss/cs46xx.c: fix a check after use
@ 2005-03-27 20:50 Adrian Bunk
0 siblings, 0 replies; 3+ messages in thread
From: Adrian Bunk @ 2005-03-27 20:50 UTC (permalink / raw)
To: linux-kernel
This patch fixes a check after use found by the Coverity checker.
Signed-off-by: Adrian Bunk <bunk@fs.tum.de>
--- linux-2.6.12-rc1-mm1-full/sound/oss/cs46xx.c.old 2005-03-23 04:48:53.000000000 +0100
+++ linux-2.6.12-rc1-mm1-full/sound/oss/cs46xx.c 2005-03-23 04:49:31.000000000 +0100
@@ -3086,13 +3086,14 @@
static void amp_hercules(struct cs_card *card, int change)
{
- int old=card->amplifier;
+ int old;
if(!card)
{
CS_DBGOUT(CS_ERROR, 2, printk(KERN_INFO
"cs46xx: amp_hercules() called before initialized.\n"));
return;
}
+ old = card->amplifier;
card->amplifier+=change;
if( (card->amplifier && !old) && !(hercules_egpio_disable))
{
^ permalink raw reply [flat|nested] 3+ messages in thread
* [2.6 patch] sound/oss/cs46xx.c: fix a check after use
@ 2005-04-13 2:17 Adrian Bunk
2005-04-13 2:35 ` Al Viro
0 siblings, 1 reply; 3+ messages in thread
From: Adrian Bunk @ 2005-04-13 2:17 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
This patch fixes a check after use found by the Coverity checker.
Signed-off-by: Adrian Bunk <bunk@fs.tum.de>
---
This patch was already sent on:
- 27 Mar 2005
--- linux-2.6.12-rc1-mm1-full/sound/oss/cs46xx.c.old 2005-03-23 04:48:53.000000000 +0100
+++ linux-2.6.12-rc1-mm1-full/sound/oss/cs46xx.c 2005-03-23 04:49:31.000000000 +0100
@@ -3086,13 +3086,14 @@
static void amp_hercules(struct cs_card *card, int change)
{
- int old=card->amplifier;
+ int old;
if(!card)
{
CS_DBGOUT(CS_ERROR, 2, printk(KERN_INFO
"cs46xx: amp_hercules() called before initialized.\n"));
return;
}
+ old = card->amplifier;
card->amplifier+=change;
if( (card->amplifier && !old) && !(hercules_egpio_disable))
{
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [2.6 patch] sound/oss/cs46xx.c: fix a check after use
2005-04-13 2:17 [2.6 patch] sound/oss/cs46xx.c: fix a check after use Adrian Bunk
@ 2005-04-13 2:35 ` Al Viro
0 siblings, 0 replies; 3+ messages in thread
From: Al Viro @ 2005-04-13 2:35 UTC (permalink / raw)
To: Adrian Bunk; +Cc: Andrew Morton, linux-kernel
On Wed, Apr 13, 2005 at 04:17:39AM +0200, Adrian Bunk wrote:
> This patch fixes a check after use found by the Coverity checker.
NAK. Please, read the surrounding code. All places that can call
that function have form
<expression>->amplifier_ctrl(<same expression>,...);
so we _can't_ get NULL first argument. The check should be removed -
it's not paranoia, it's simple stupidity.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-04-13 2:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-13 2:17 [2.6 patch] sound/oss/cs46xx.c: fix a check after use Adrian Bunk
2005-04-13 2:35 ` Al Viro
-- strict thread matches above, loose matches on Subject: below --
2005-03-27 20:50 Adrian Bunk
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.