mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
memstick: core: fix device_register() error handling
If device_register() fails then call put_device(). See comment to device_register. Signed-off-by: Vasiliy Kulikov <[email protected]> Cc: Maxim Levitsky <[email protected]> Cc: Alex Dubov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
563558b2c7
commit
0193383a58
1 changed files with 1 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue