提交 c179a289 编写于 作者: J John Ogness 提交者: Ben Warren

fec_mxc: incomplete error handling

fec_init() will only allocate fec->base_ptr if it is non-NULL. But
the cleanup routine on error will free the pointer without setting
it to NULL. This means that a later call to fec_init() would result
in using an invalid pointer.
Signed-off-by: NJohn Ogness <john.ogness@linutronix.de>
Signed-off-by: NBen Warren <biggerbadderben@gmail.com>
上级 2ab4a4d0
......@@ -450,6 +450,7 @@ static int fec_init(struct eth_device *dev, bd_t* bd)
*/
if (fec_rbd_init(fec, FEC_RBD_NUM, FEC_MAX_PKT_SIZE) < 0) {
free(fec->base_ptr);
fec->base_ptr = NULL;
return -ENOMEM;
}
fec_tbd_init(fec);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册