mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
rapidio: fix potential null deref on failure path
If rio is not a switch then "rswitch" is null. Signed-off-by: Dan Carpenter <[email protected]> Cc: Matt Porter <[email protected]> Cc: Kumar Gala <[email protected]> Signed-off-by: Alexandre Bounine <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
c1256ebe6a
commit
ad4ac17ad1
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue