diff options
Diffstat (limited to 'drivers/char/n_gsm.c')
-rw-r--r-- | drivers/char/n_gsm.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/char/n_gsm.c b/drivers/char/n_gsm.c index 04ef3ef0a422..0e62674072eb 100644 --- a/drivers/char/n_gsm.c +++ b/drivers/char/n_gsm.c | |||
@@ -716,8 +716,8 @@ static void __gsm_data_queue(struct gsm_dlci *dlci, struct gsm_msg *msg) | |||
716 | if (msg->len < 128) | 716 | if (msg->len < 128) |
717 | *--dp = (msg->len << 1) | EA; | 717 | *--dp = (msg->len << 1) | EA; |
718 | else { | 718 | else { |
719 | *--dp = (msg->len >> 6) | EA; | 719 | *--dp = (msg->len >> 7); /* bits 7 - 15 */ |
720 | *--dp = (msg->len & 127) << 1; | 720 | *--dp = (msg->len & 127) << 1; /* bits 0 - 6 */ |
721 | } | 721 | } |
722 | } | 722 | } |
723 | 723 | ||
@@ -968,6 +968,8 @@ static void gsm_control_reply(struct gsm_mux *gsm, int cmd, u8 *data, | |||
968 | { | 968 | { |
969 | struct gsm_msg *msg; | 969 | struct gsm_msg *msg; |
970 | msg = gsm_data_alloc(gsm, 0, dlen + 2, gsm->ftype); | 970 | msg = gsm_data_alloc(gsm, 0, dlen + 2, gsm->ftype); |
971 | if (msg == NULL) | ||
972 | return; | ||
971 | msg->data[0] = (cmd & 0xFE) << 1 | EA; /* Clear C/R */ | 973 | msg->data[0] = (cmd & 0xFE) << 1 | EA; /* Clear C/R */ |
972 | msg->data[1] = (dlen << 1) | EA; | 974 | msg->data[1] = (dlen << 1) | EA; |
973 | memcpy(msg->data + 2, data, dlen); | 975 | memcpy(msg->data + 2, data, dlen); |