mirror of
https://github.com/torvalds/linux.git
synced 2024-12-16 16:12:52 +00:00
drivers/net: Correct redundant test
res has already been tested. It seems that this test should be on the recently returned value mmio. A simplified version of the semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @r exists@ local idexpression x; expression E; @@ if (x == NULL || ...) { ... when forall return ...; } ... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\) ( *x == NULL | *x != NULL ) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f004ec728b
commit
463889e27e
@ -894,7 +894,7 @@ static int ethoc_probe(struct platform_device *pdev)
|
||||
|
||||
mmio = devm_request_mem_region(&pdev->dev, res->start,
|
||||
res->end - res->start + 1, res->name);
|
||||
if (!res) {
|
||||
if (!mmio) {
|
||||
dev_err(&pdev->dev, "cannot request I/O memory space\n");
|
||||
ret = -ENXIO;
|
||||
goto free;
|
||||
|
Loading…
Reference in New Issue
Block a user