Skip to content

Commit

Permalink
atm: lanai: set error code when ioremap fails
Browse files Browse the repository at this point in the history
In function lanai_dev_open(), when the call to ioremap() fails, the
value of return variable result is 0. 0 means no error in this context.
This patch fixes the bug, assigning "-ENOMEM" to result when ioremap()
returns a NULL pointer.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188791

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
SinkFinder authored and davem330 committed Dec 5, 2016
1 parent 5192083 commit 4606c9e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/atm/lanai.c
Original file line number Diff line number Diff line change
Expand Up @@ -2143,6 +2143,7 @@ static int lanai_dev_open(struct atm_dev *atmdev)
lanai->base = (bus_addr_t) ioremap(raw_base, LANAI_MAPPING_SIZE);
if (lanai->base == NULL) {
printk(KERN_ERR DEV_LABEL ": couldn't remap I/O space\n");
result = -ENOMEM;
goto error_pci;
}
/* 3.3: Reset lanai and PHY */
Expand Down

0 comments on commit 4606c9e

Please sign in to comment.