Skip to content

Commit 81b8be6

Browse files
Xie Hekuba-moo
authored andcommitted
net: hdlc_x25: Return meaningful error code in x25_open
It's not meaningful to pass on LAPB error codes to HDLC code or other parts of the system, because they will not understand the error codes. Instead, use system-wide recognizable error codes. Fixes: f362e5f ("wan/hdlc_x25: make lapb params configurable") Fixes: 1da177e ("Linux-2.6.12-rc2") Signed-off-by: Xie He <xie.he.0141@gmail.com> Acked-by: Martin Schiller <ms@dev.tdt.de> Link: https://lore.kernel.org/r/20210203071541.86138-1-xie.he.0141@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 7b5eab5 commit 81b8be6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/net/wan/hdlc_x25.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ static int x25_open(struct net_device *dev)
169169

170170
result = lapb_register(dev, &cb);
171171
if (result != LAPB_OK)
172-
return result;
172+
return -ENOMEM;
173173

174174
result = lapb_getparms(dev, &params);
175175
if (result != LAPB_OK)
176-
return result;
176+
return -EINVAL;
177177

178178
if (state(hdlc)->settings.dce)
179179
params.mode = params.mode | LAPB_DCE;
@@ -188,7 +188,7 @@ static int x25_open(struct net_device *dev)
188188

189189
result = lapb_setparms(dev, &params);
190190
if (result != LAPB_OK)
191-
return result;
191+
return -EINVAL;
192192

193193
return 0;
194194
}

0 commit comments

Comments
 (0)