]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[ATM] firestream: handle thrown error
authorJeff Garzik <jeff@garzik.org>
Wed, 21 Feb 2007 00:42:39 +0000 (01:42 +0100)
committerAdrian Bunk <bunk@stusta.de>
Wed, 21 Feb 2007 00:42:39 +0000 (01:42 +0100)
gcc emits the following warning:

drivers/atm/firestream.c: In function ‘fs_open’:
drivers/atm/firestream.c:870: warning: ‘tmc0’ may be used uninitialized in this function

This indicates a real bug.  We should check make_rate() return value for
potential errors.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
drivers/atm/firestream.c

index 7f7ec288824d075ed2826422e113abba8bebd1a1..01eebd1ab80d6f3199e01f5f753ef80cb1cd6b43 100644 (file)
@@ -1001,6 +1001,10 @@ static int fs_open(struct atm_vcc *atm_vcc)
                                        r = ROUND_UP;
                                }
                                error = make_rate (pcr, r, &tmc0, NULL);
+                               if (error) {
+                                       kfree(tc);
+                                       return error;
+                               }
                        }
                        fs_dprintk (FS_DEBUG_OPEN, "pcr = %d.\n", pcr);
                }