forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/memstick/core/memstick.c
....@@ -1,15 +1,11 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Sony MemoryStick support
34 *
45 * Copyright (C) 2007 Alex Dubov <oakad@yahoo.com>
56 *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2 as
8
- * published by the Free Software Foundation.
9
- *
107 * Special thanks to Carlos Corbacho for providing various MemoryStick cards
118 * that made this driver possible.
12
- *
139 */
1410
1511 #include <linux/memstick.h>
....@@ -445,6 +441,9 @@
445441 } else if (host->card->stop)
446442 host->card->stop(host->card);
447443
444
+ if (host->removing)
445
+ goto out_power_off;
446
+
448447 card = memstick_alloc_card(host);
449448
450449 if (!card) {
....@@ -548,6 +547,7 @@
548547 */
549548 void memstick_remove_host(struct memstick_host *host)
550549 {
550
+ host->removing = 1;
551551 flush_workqueue(workqueue);
552552 mutex_lock(&host->lock);
553553 if (host->card)