Damien Le Moal
341b5e1016
ata: libata-scsi: Fix ata_scsi_dev_rescan() error path
...
commit 79336504781e7fee5ddaf046dcc186c8dfdf60b1 upstream.
Commit 0c76106cb975 ("scsi: sd: Fix TCG OPAL unlock on system resume")
incorrectly handles failures of scsi_resume_device() in
ata_scsi_dev_rescan(), leading to a double call to
spin_unlock_irqrestore() to unlock a device port. Fix this by redefining
the goto labels used in case of errors and only unlock the port
scsi_scan_mutex when scsi_resume_device() fails.
Bug found with the Smatch static checker warning:
drivers/ata/libata-scsi.c:4774 ata_scsi_dev_rescan()
error: double unlocked 'ap->lock' (orig line 4757)
Reported-by: Dan Carpenter <dan.carpenter@linaro.org >
Fixes: 0c76106cb975 ("scsi: sd: Fix TCG OPAL unlock on system resume")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org >
Reviewed-by: Niklas Cassel <cassel@kernel.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2024-04-17 11:19:25 +02:00
..
2024-04-13 13:07:35 +02:00
2024-04-03 15:28:28 +02:00
2024-04-13 13:07:36 +02:00
2023-08-22 15:50:57 +02:00
2024-02-23 09:25:04 +01:00
2024-04-17 11:19:25 +02:00
2024-02-16 19:10:49 +01:00
2023-08-30 13:34:34 -07:00
2024-04-10 16:36:03 +02:00
2024-03-26 18:19:19 -04:00
2024-04-13 13:07:41 +02:00
2024-04-13 13:07:38 +02:00
2024-03-01 13:35:08 +01:00
2024-04-03 15:28:31 +02:00
2024-04-03 15:28:23 +02:00
2024-04-03 15:28:50 +02:00
2024-03-26 18:20:04 -04:00
2024-02-23 09:25:01 +01:00
2023-10-02 13:13:15 +02:00
2024-04-13 13:07:32 +02:00
2024-04-13 13:07:29 +02:00
2024-04-03 15:28:40 +02:00
2024-04-03 15:28:36 +02:00
2023-08-24 16:20:30 -07:00
2024-02-05 20:14:15 +00:00
2024-03-26 18:19:43 -04:00
2024-04-10 16:35:40 +02:00
2024-01-25 15:35:12 -08:00
2024-02-05 20:14:31 +00:00
2024-04-03 15:28:41 +02:00
2024-04-13 13:07:31 +02:00
2023-10-24 19:32:39 +02:00
2023-08-22 15:51:33 +02:00
2024-04-10 16:36:02 +02:00
2024-04-13 13:07:41 +02:00
2024-04-13 13:07:36 +02:00
2023-11-20 11:59:08 +01:00
2024-03-26 18:20:06 -04:00
2024-04-03 15:28:28 +02:00
2024-03-26 18:20:06 -04:00
2024-04-13 13:07:35 +02:00
2024-03-26 18:20:01 -04:00
2024-01-25 15:35:12 -08:00
2024-04-03 15:28:45 +02:00
2024-04-13 13:07:37 +02:00
2024-04-13 13:07:37 +02:00
2024-02-23 09:24:57 +01:00
2024-04-03 15:28:51 +02:00
2023-08-11 21:12:46 +02:00
2024-04-03 15:28:52 +02:00
2023-10-23 09:39:46 +01:00
2024-04-03 15:28:27 +02:00
2023-08-31 12:43:10 -07:00
2024-02-05 20:14:31 +00:00
2023-11-28 17:20:05 +00:00
2024-04-10 16:35:45 +02:00
2024-04-13 13:07:40 +02:00
2024-03-26 18:19:32 -04:00
2024-03-26 18:19:55 -04:00
2024-04-13 13:07:41 +02:00
2024-04-03 15:28:56 +02:00
2024-04-03 15:28:35 +02:00
2023-08-28 13:36:24 -05:00
2024-04-13 13:07:33 +02:00
2023-12-20 17:01:59 +01:00
2024-03-26 18:19:48 -04:00
2023-11-20 11:59:19 +01:00
2024-04-13 13:07:39 +02:00
2024-04-03 15:28:28 +02:00
2024-04-10 16:36:06 +02:00
2024-03-26 18:19:40 -04:00
2024-01-31 16:18:52 -08:00
2024-01-20 11:51:48 +01:00
2024-04-03 15:28:30 +02:00
2023-11-20 11:59:31 +01:00
2024-04-13 13:07:36 +02:00
2024-04-03 15:28:28 +02:00
2024-04-13 13:07:34 +02:00
2024-04-13 13:07:40 +02:00
2024-04-13 13:07:30 +02:00
2024-02-05 20:14:15 +00:00
2024-03-06 14:48:37 +00:00
2024-04-03 15:28:19 +02:00
2023-11-28 17:19:51 +00:00
2024-04-03 15:28:52 +02:00
2024-03-26 18:19:34 -04:00
2024-04-03 15:28:16 +02:00
2024-01-20 11:51:44 +01:00
2024-01-31 16:18:50 -08:00
2024-03-26 18:20:06 -04:00
2024-04-10 16:35:42 +02:00
2023-08-28 13:36:24 -05:00
2024-04-13 13:07:34 +02:00
2024-04-03 15:28:28 +02:00
2024-04-03 15:28:32 +02:00
2024-04-13 13:07:34 +02:00
2024-04-10 16:36:01 +02:00
2024-02-05 20:14:32 +00:00
2024-04-03 15:28:59 +02:00
2024-03-01 13:34:59 +01:00
2024-04-03 15:28:44 +02:00
2024-04-13 13:07:39 +02:00
2024-04-13 13:07:38 +02:00
2024-04-03 15:28:43 +02:00
2024-03-01 13:34:55 +01:00
2024-01-20 11:51:48 +01:00
2024-04-13 13:07:38 +02:00
2024-03-26 18:20:10 -04:00
2024-04-03 15:28:59 +02:00
2024-01-25 15:35:26 -08:00
2024-04-13 13:07:40 +02:00
2023-11-20 11:59:30 +01:00
2024-04-03 15:28:36 +02:00
2023-09-13 10:48:42 +02:00
2024-03-26 18:20:02 -04:00
2024-04-13 13:07:39 +02:00
2023-08-21 13:27:44 +02:00
2023-09-08 11:24:34 -07:00
2023-09-13 11:09:21 +02:00