aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wan/hdlc_ppp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/wan/hdlc_ppp.c b/drivers/net/wan/hdlc_ppp.c
index 72fae217f1c4..57fe714c1c7f 100644
--- a/drivers/net/wan/hdlc_ppp.c
+++ b/drivers/net/wan/hdlc_ppp.c
@@ -303,7 +303,7 @@ static int cp_table[EVENTS][STATES] = {
303 STA: RTR must supply id 303 STA: RTR must supply id
304 SCJ: RUC must supply CP packet len and data */ 304 SCJ: RUC must supply CP packet len and data */
305static void ppp_cp_event(struct net_device *dev, u16 pid, u16 event, u8 code, 305static void ppp_cp_event(struct net_device *dev, u16 pid, u16 event, u8 code,
306 u8 id, unsigned int len, void *data) 306 u8 id, unsigned int len, const void *data)
307{ 307{
308 int old_state, action; 308 int old_state, action;
309 struct ppp *ppp = get_ppp(dev); 309 struct ppp *ppp = get_ppp(dev);
@@ -374,11 +374,12 @@ static void ppp_cp_event(struct net_device *dev, u16 pid, u16 event, u8 code,
374 374
375 375
376static void ppp_cp_parse_cr(struct net_device *dev, u16 pid, u8 id, 376static void ppp_cp_parse_cr(struct net_device *dev, u16 pid, u8 id,
377 unsigned int len, u8 *data) 377 unsigned int req_len, const u8 *data)
378{ 378{
379 static u8 const valid_accm[6] = { LCP_OPTION_ACCM, 6, 0, 0, 0, 0 }; 379 static u8 const valid_accm[6] = { LCP_OPTION_ACCM, 6, 0, 0, 0, 0 };
380 u8 *opt, *out; 380 const u8 *opt;
381 unsigned int nak_len = 0, rej_len = 0; 381 u8 *out;
382 unsigned int len = req_len, nak_len = 0, rej_len = 0;
382 383
383 if (!(out = kmalloc(len, GFP_ATOMIC))) { 384 if (!(out = kmalloc(len, GFP_ATOMIC))) {
384 dev->stats.rx_dropped++; 385 dev->stats.rx_dropped++;
@@ -423,7 +424,7 @@ static void ppp_cp_parse_cr(struct net_device *dev, u16 pid, u8 id,
423 else if (nak_len) 424 else if (nak_len)
424 ppp_cp_event(dev, pid, RCR_BAD, CP_CONF_NAK, id, nak_len, out); 425 ppp_cp_event(dev, pid, RCR_BAD, CP_CONF_NAK, id, nak_len, out);
425 else 426 else
426 ppp_cp_event(dev, pid, RCR_GOOD, CP_CONF_ACK, id, len, data); 427 ppp_cp_event(dev, pid, RCR_GOOD, CP_CONF_ACK, id, req_len, data);
427 428
428 kfree(out); 429 kfree(out);
429} 430}