Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad4ac17a authored by Dan Carpenter's avatar Dan Carpenter Committed by Linus Torvalds
Browse files

rapidio: fix potential null deref on failure path



If rio is not a switch then "rswitch" is null.

Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: default avatarAlexandre Bounine <alexandre.bounine@idt.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c1256ebe
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);