mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-26 05:00:53 +07:00
drivers/net/a2065.c: Convert release_resource to release_region/release_mem_region
Request_mem_region should be used with release_mem_region, not release_resource. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,E; @@ *x = request_mem_region(...) ... when != release_mem_region(x) when != x = E * release_resource(x); // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
88e87be6ba
commit
e6937ee626
@ -711,14 +711,14 @@ static int __devinit a2065_init_one(struct zorro_dev *z,
|
||||
return -EBUSY;
|
||||
r2 = request_mem_region(mem_start, A2065_RAM_SIZE, "RAM");
|
||||
if (!r2) {
|
||||
release_resource(r1);
|
||||
release_mem_region(base_addr, sizeof(struct lance_regs));
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
dev = alloc_etherdev(sizeof(struct lance_private));
|
||||
if (dev == NULL) {
|
||||
release_resource(r1);
|
||||
release_resource(r2);
|
||||
release_mem_region(base_addr, sizeof(struct lance_regs));
|
||||
release_mem_region(mem_start, A2065_RAM_SIZE);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
@ -764,8 +764,8 @@ static int __devinit a2065_init_one(struct zorro_dev *z,
|
||||
|
||||
err = register_netdev(dev);
|
||||
if (err) {
|
||||
release_resource(r1);
|
||||
release_resource(r2);
|
||||
release_mem_region(base_addr, sizeof(struct lance_regs));
|
||||
release_mem_region(mem_start, A2065_RAM_SIZE);
|
||||
free_netdev(dev);
|
||||
return err;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user