diff options
author | Vladislav Efanov <VEfanov@ispras.ru> | 2023-05-17 15:50:25 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-05-31 21:03:39 +0300 |
commit | 6bea9ea6bb21ccee2aad0aa2a845499e0aa2f7f9 (patch) | |
tree | 1c6a24ece773cb3dbf35ee5ed6d2b56706d40905 /drivers/base | |
parent | 54aa5b6044f89af046bcb7a9d0ca6408c0ebdd1f (diff) | |
download | linux-6bea9ea6bb21ccee2aad0aa2a845499e0aa2f7f9.tar.xz |
isa: Remove unnecessary checks
The isa_dev->dev.platform_data is initialized with incoming
parameter isa_driver. After it isa_dev->dev.platform_data is
checked for NULL, but incoming parameter isa_driver is not
NULL since it is dereferenced many times before this check.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Vladislav Efanov <VEfanov@ispras.ru>
Acked-by: William Breathitt Gray <william.gray@linaro.org>
Link: https://lore.kernel.org/r/20230517125025.434005-1-VEfanov@ispras.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/isa.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/base/isa.c b/drivers/base/isa.c index 55e3ee2da98f..675ad3139224 100644 --- a/drivers/base/isa.c +++ b/drivers/base/isa.c @@ -149,11 +149,8 @@ int isa_register_driver(struct isa_driver *isa_driver, unsigned int ndev) break; } - if (isa_dev->dev.platform_data) { - isa_dev->next = isa_driver->devices; - isa_driver->devices = &isa_dev->dev; - } else - device_unregister(&isa_dev->dev); + isa_dev->next = isa_driver->devices; + isa_driver->devices = &isa_dev->dev; } if (!error && !isa_driver->devices) |