diff options
author | Pan Bian <bianpan2016@163.com> | 2016-12-03 07:25:45 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-12-05 13:27:33 -0500 |
commit | 4606c9e8c541f97034e53e644129376a6170b8c7 (patch) | |
tree | dadbc5b83a85d7202b93c1c2dbb849a344ba96dd /drivers/atm | |
parent | 51920830d9d0eb617af18dc60443fcd4fb50a533 (diff) |
atm: lanai: set error code when ioremap fails
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>
Diffstat (limited to 'drivers/atm')
-rw-r--r-- | drivers/atm/lanai.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index ce43ae3e87b3..445505d9ea07 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c | |||
@@ -2143,6 +2143,7 @@ static int lanai_dev_open(struct atm_dev *atmdev) | |||
2143 | lanai->base = (bus_addr_t) ioremap(raw_base, LANAI_MAPPING_SIZE); | 2143 | lanai->base = (bus_addr_t) ioremap(raw_base, LANAI_MAPPING_SIZE); |
2144 | if (lanai->base == NULL) { | 2144 | if (lanai->base == NULL) { |
2145 | printk(KERN_ERR DEV_LABEL ": couldn't remap I/O space\n"); | 2145 | printk(KERN_ERR DEV_LABEL ": couldn't remap I/O space\n"); |
2146 | result = -ENOMEM; | ||
2146 | goto error_pci; | 2147 | goto error_pci; |
2147 | } | 2148 | } |
2148 | /* 3.3: Reset lanai and PHY */ | 2149 | /* 3.3: Reset lanai and PHY */ |