提交 663bab6f 编写于 作者: J Jeff Garzik 提交者: David S. Miller

[ATM] firestream: handle thrown error

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: NJeff Garzik <jeff@garzik.org>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b45eccdb
...@@ -1002,6 +1002,10 @@ static int fs_open(struct atm_vcc *atm_vcc) ...@@ -1002,6 +1002,10 @@ static int fs_open(struct atm_vcc *atm_vcc)
r = ROUND_UP; r = ROUND_UP;
} }
error = make_rate (pcr, r, &tmc0, NULL); error = make_rate (pcr, r, &tmc0, NULL);
if (error) {
kfree(tc);
return error;
}
} }
fs_dprintk (FS_DEBUG_OPEN, "pcr = %d.\n", pcr); fs_dprintk (FS_DEBUG_OPEN, "pcr = %d.\n", pcr);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册