The resource is checked in probe function, so there is no need do this check in remove function. Signed-off-by: Ruan Jinjie <ruanjinjie@xxxxxxxxxx> --- drivers/block/swim.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/swim.c b/drivers/block/swim.c index f85b6af414b4..6f7b5e15fd6d 100644 --- a/drivers/block/swim.c +++ b/drivers/block/swim.c @@ -933,8 +933,7 @@ static int swim_remove(struct platform_device *dev) floppy_eject(&swd->unit[drive]); res = platform_get_resource(dev, IORESOURCE_MEM, 0); - if (res) - release_mem_region(res->start, resource_size(res)); + release_mem_region(res->start, resource_size(res)); kfree(swd); -- 2.34.1