Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'tty-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6

* 'tty-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6:
n_gsm: gsm_data_alloc buffer allocation could fail and it is not being checked
n_gsm: Fix message length handling when building header

+4 -2
+4 -2
drivers/tty/n_gsm.c
··· 716 716 if (msg->len < 128) 717 717 *--dp = (msg->len << 1) | EA; 718 718 else { 719 - *--dp = ((msg->len & 127) << 1) | EA; 720 - *--dp = (msg->len >> 6) & 0xfe; 719 + *--dp = (msg->len >> 7); /* bits 7 - 15 */ 720 + *--dp = (msg->len & 127) << 1; /* bits 0 - 6 */ 721 721 } 722 722 } 723 723 ··· 968 968 { 969 969 struct gsm_msg *msg; 970 970 msg = gsm_data_alloc(gsm, 0, dlen + 2, gsm->ftype); 971 + if (msg == NULL) 972 + return; 971 973 msg->data[0] = (cmd & 0xFE) << 1 | EA; /* Clear C/R */ 972 974 msg->data[1] = (dlen << 1) | EA; 973 975 memcpy(msg->data + 2, data, dlen);