Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 463889e2 authored by Julia Lawall's avatar Julia Lawall Committed by David S. Miller
Browse files

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: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f004ec72
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;