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

Commit 0193383a authored by Vasiliy Kulikov's avatar Vasiliy Kulikov Committed by Linus Torvalds
Browse files

memstick: core: fix device_register() error handling



If device_register() fails then call put_device().  See comment to
device_register.

Signed-off-by: default avatarVasiliy Kulikov <segooon@gmail.com>
Cc: Maxim Levitsky <maximlevitsky@gmail.com>
Cc: Alex Dubov <oakad@yahoo.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 563558b2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -465,6 +465,7 @@ static void memstick_check(struct work_struct *work)
		if (!host->card) {
			host->card = card;
			if (device_register(&card->dev)) {
				put_device(&card->dev);
				kfree(host->card);
				host->card = NULL;
			}