Skip to content

Commit 6bea9ea

Browse files
Vlad4896gregkh
authored andcommitted
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>
1 parent 54aa5b6 commit 6bea9ea

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

drivers/base/isa.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,8 @@ int isa_register_driver(struct isa_driver *isa_driver, unsigned int ndev)
149149
break;
150150
}
151151

152-
if (isa_dev->dev.platform_data) {
153-
isa_dev->next = isa_driver->devices;
154-
isa_driver->devices = &isa_dev->dev;
155-
} else
156-
device_unregister(&isa_dev->dev);
152+
isa_dev->next = isa_driver->devices;
153+
isa_driver->devices = &isa_dev->dev;
157154
}
158155

159156
if (!error && !isa_driver->devices)

0 commit comments

Comments
 (0)