|
Kmods SIG |
d0f18f |
From 4dc98c1995482262e70e83ef029135247fafe0f2 Mon Sep 17 00:00:00 2001
|
|
Kmods SIG |
d0f18f |
From: Anton Vasilyev <vasilyev@ispras.ru>
|
|
Kmods SIG |
d0f18f |
Date: Fri, 27 Jul 2018 16:51:57 +0300
|
|
Kmods SIG |
d0f18f |
Subject: [Backport 4dc98c199548] scsi: 3ware: fix return 0 on the error path
|
|
Kmods SIG |
d0f18f |
of probe
|
|
Kmods SIG |
d0f18f |
|
|
Kmods SIG |
d0f18f |
tw_probe() returns 0 in case of fail of tw_initialize_device_extension(),
|
|
Kmods SIG |
d0f18f |
pci_resource_start() or tw_reset_sequence() and releases resources.
|
|
Kmods SIG |
d0f18f |
twl_probe() returns 0 in case of fail of twl_initialize_device_extension(),
|
|
Kmods SIG |
d0f18f |
pci_iomap() and twl_reset_sequence(). twa_probe() returns 0 in case of
|
|
Kmods SIG |
d0f18f |
fail of tw_initialize_device_extension(), ioremap() and
|
|
Kmods SIG |
d0f18f |
twa_reset_sequence().
|
|
Kmods SIG |
d0f18f |
|
|
Kmods SIG |
d0f18f |
The patch adds retval initialization for these cases.
|
|
Kmods SIG |
d0f18f |
|
|
Kmods SIG |
d0f18f |
Found by Linux Driver Verification project (linuxtesting.org).
|
|
Kmods SIG |
d0f18f |
|
|
Kmods SIG |
d0f18f |
Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru>
|
|
Kmods SIG |
d0f18f |
Acked-by: Adam Radford <aradford@gmail.com>
|
|
Kmods SIG |
d0f18f |
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
|
|
Kmods SIG |
d0f18f |
---
|
|
Kmods SIG |
d0f18f |
src/3w-xxxx.c | 2 ++
|
|
Kmods SIG |
d0f18f |
1 file changed, 2 insertions(+)
|
|
Kmods SIG |
d0f18f |
|
|
Kmods SIG |
d0f18f |
diff --git a/src/3w-xxxx.c b/src/3w-xxxx.c
|
|
Kmods SIG |
d0f18f |
index a40d353bd8b3981986ee1e4fea3ed6771b078f7e..471366945bd4fc8b3d92ede8247f8a4d5706d508 100644
|
|
Kmods SIG |
d0f18f |
--- a/src/3w-xxxx.c
|
|
Kmods SIG |
d0f18f |
+++ b/src/3w-xxxx.c
|
|
Kmods SIG |
d0f18f |
@@ -2280,6 +2280,7 @@ static int tw_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
|
|
Kmods SIG |
d0f18f |
|
|
Kmods SIG |
d0f18f |
if (tw_initialize_device_extension(tw_dev)) {
|
|
Kmods SIG |
d0f18f |
printk(KERN_WARNING "3w-xxxx: Failed to initialize device extension.");
|
|
Kmods SIG |
d0f18f |
+ retval = -ENOMEM;
|
|
Kmods SIG |
d0f18f |
goto out_free_device_extension;
|
|
Kmods SIG |
d0f18f |
}
|
|
Kmods SIG |
d0f18f |
|
|
Kmods SIG |
d0f18f |
@@ -2294,6 +2295,7 @@ static int tw_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
|
|
Kmods SIG |
d0f18f |
tw_dev->base_addr = pci_resource_start(pdev, 0);
|
|
Kmods SIG |
d0f18f |
if (!tw_dev->base_addr) {
|
|
Kmods SIG |
d0f18f |
printk(KERN_WARNING "3w-xxxx: Failed to get io address.");
|
|
Kmods SIG |
d0f18f |
+ retval = -ENOMEM;
|
|
Kmods SIG |
d0f18f |
goto out_release_mem_region;
|
|
Kmods SIG |
d0f18f |
}
|
|
Kmods SIG |
d0f18f |
|
|
Kmods SIG |
d0f18f |
--
|
|
Kmods SIG |
d0f18f |
2.31.1
|
|
Kmods SIG |
d0f18f |
|