提交 ad4ac17a 编写于 作者: D Dan Carpenter 提交者: Linus Torvalds

rapidio: fix potential null deref on failure path

If rio is not a switch then "rswitch" is null.
Signed-off-by: NDan Carpenter <error27@gmail.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: NAlexandre Bounine <alexandre.bounine@idt.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 c1256ebe
......@@ -517,7 +517,7 @@ static struct rio_dev __devinit *rio_setup_device(struct rio_net *net,
return rdev;
cleanup:
if (rswitch->route_table)
if (rio_is_switch(rdev))
kfree(rswitch->route_table);
kfree(rdev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册