mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] atm/firestream: handle thrown error
@ 2006-10-10  7:32 Jeff Garzik
  0 siblings, 0 replies; only message in thread
From: Jeff Garzik @ 2006-10-10  7:32 UTC (permalink / raw)
  To: chas, Andrew Morton, LKML


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>

---

 drivers/atm/firestream.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
index 40ab9b6..697ad82 100644
--- a/drivers/atm/firestream.c
+++ b/drivers/atm/firestream.c
@@ -1002,6 +1002,10 @@ static int fs_open(struct atm_vcc *atm_v
 					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);
 		}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-10-10  7:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-10  7:32 [PATCH] atm/firestream: handle thrown error Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®