diff options
Diffstat (limited to 'drivers/isdn')
-rw-r--r-- | drivers/isdn/hardware/eicon/maintidi.c | 5 | ||||
-rw-r--r-- | drivers/isdn/hardware/eicon/message.c | 18 | ||||
-rw-r--r-- | drivers/isdn/hisax/amd7930_fn.c | 1 | ||||
-rw-r--r-- | drivers/isdn/hisax/diva.c | 2 | ||||
-rw-r--r-- | drivers/isdn/hisax/hfc_usb.c | 4 | ||||
-rw-r--r-- | drivers/isdn/hisax/hscx_irq.c | 2 | ||||
-rw-r--r-- | drivers/isdn/hisax/icc.c | 1 | ||||
-rw-r--r-- | drivers/isdn/mISDN/stack.c | 2 |
8 files changed, 19 insertions, 16 deletions
diff --git a/drivers/isdn/hardware/eicon/maintidi.c b/drivers/isdn/hardware/eicon/maintidi.c index 23960cb6eaab..41c26e756452 100644 --- a/drivers/isdn/hardware/eicon/maintidi.c +++ b/drivers/isdn/hardware/eicon/maintidi.c | |||
@@ -959,8 +959,9 @@ static int process_idi_event (diva_strace_context_t* pLib, | |||
959 | } | 959 | } |
960 | if (!strncmp("State\\Layer2 No1", path, pVar->path_length)) { | 960 | if (!strncmp("State\\Layer2 No1", path, pVar->path_length)) { |
961 | char* tmp = &pLib->lines[0].pInterface->Layer2[0]; | 961 | char* tmp = &pLib->lines[0].pInterface->Layer2[0]; |
962 | dword l2_state; | 962 | dword l2_state; |
963 | diva_strace_read_uint (pVar, &l2_state); | 963 | if (diva_strace_read_uint(pVar, &l2_state)) |
964 | return -1; | ||
964 | 965 | ||
965 | switch (l2_state) { | 966 | switch (l2_state) { |
966 | case 0: | 967 | case 0: |
diff --git a/drivers/isdn/hardware/eicon/message.c b/drivers/isdn/hardware/eicon/message.c index 27d5dd68f4fb..ae89fb89da64 100644 --- a/drivers/isdn/hardware/eicon/message.c +++ b/drivers/isdn/hardware/eicon/message.c | |||
@@ -2692,7 +2692,7 @@ static byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a, | |||
2692 | if (!(fax_control_bits & T30_CONTROL_BIT_MORE_DOCUMENTS) | 2692 | if (!(fax_control_bits & T30_CONTROL_BIT_MORE_DOCUMENTS) |
2693 | || (fax_feature_bits & T30_FEATURE_BIT_MORE_DOCUMENTS)) | 2693 | || (fax_feature_bits & T30_FEATURE_BIT_MORE_DOCUMENTS)) |
2694 | { | 2694 | { |
2695 | len = (byte)(&(((T30_INFO *) 0)->universal_6)); | 2695 | len = offsetof(T30_INFO, universal_6); |
2696 | fax_info_change = false; | 2696 | fax_info_change = false; |
2697 | if (ncpi->length >= 4) | 2697 | if (ncpi->length >= 4) |
2698 | { | 2698 | { |
@@ -2754,7 +2754,7 @@ static byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a, | |||
2754 | for (i = 0; i < w; i++) | 2754 | for (i = 0; i < w; i++) |
2755 | ((T30_INFO *)(plci->fax_connect_info_buffer))->station_id[i] = fax_parms[4].info[1+i]; | 2755 | ((T30_INFO *)(plci->fax_connect_info_buffer))->station_id[i] = fax_parms[4].info[1+i]; |
2756 | ((T30_INFO *)(plci->fax_connect_info_buffer))->head_line_len = 0; | 2756 | ((T30_INFO *)(plci->fax_connect_info_buffer))->head_line_len = 0; |
2757 | len = (byte)(((T30_INFO *) 0)->station_id + 20); | 2757 | len = offsetof(T30_INFO, station_id) + 20; |
2758 | w = fax_parms[5].length; | 2758 | w = fax_parms[5].length; |
2759 | if (w > 20) | 2759 | if (w > 20) |
2760 | w = 20; | 2760 | w = 20; |
@@ -2788,7 +2788,7 @@ static byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a, | |||
2788 | } | 2788 | } |
2789 | else | 2789 | else |
2790 | { | 2790 | { |
2791 | len = (byte)(&(((T30_INFO *) 0)->universal_6)); | 2791 | len = offsetof(T30_INFO, universal_6); |
2792 | } | 2792 | } |
2793 | fax_info_change = true; | 2793 | fax_info_change = true; |
2794 | 2794 | ||
@@ -2892,7 +2892,7 @@ static byte connect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a, | |||
2892 | && (plci->nsf_control_bits & T30_NSF_CONTROL_BIT_ENABLE_NSF) | 2892 | && (plci->nsf_control_bits & T30_NSF_CONTROL_BIT_ENABLE_NSF) |
2893 | && (plci->nsf_control_bits & T30_NSF_CONTROL_BIT_NEGOTIATE_RESP)) | 2893 | && (plci->nsf_control_bits & T30_NSF_CONTROL_BIT_NEGOTIATE_RESP)) |
2894 | { | 2894 | { |
2895 | len = ((byte)(((T30_INFO *) 0)->station_id + 20)); | 2895 | len = offsetof(T30_INFO, station_id) + 20; |
2896 | if (plci->fax_connect_info_length < len) | 2896 | if (plci->fax_connect_info_length < len) |
2897 | { | 2897 | { |
2898 | ((T30_INFO *)(plci->fax_connect_info_buffer))->station_id_len = 0; | 2898 | ((T30_INFO *)(plci->fax_connect_info_buffer))->station_id_len = 0; |
@@ -3802,7 +3802,7 @@ static byte manufacturer_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a, | |||
3802 | break; | 3802 | break; |
3803 | } | 3803 | } |
3804 | ncpi = &m_parms[1]; | 3804 | ncpi = &m_parms[1]; |
3805 | len = ((byte)(((T30_INFO *) 0)->station_id + 20)); | 3805 | len = offsetof(T30_INFO, station_id) + 20; |
3806 | if (plci->fax_connect_info_length < len) | 3806 | if (plci->fax_connect_info_length < len) |
3807 | { | 3807 | { |
3808 | ((T30_INFO *)(plci->fax_connect_info_buffer))->station_id_len = 0; | 3808 | ((T30_INFO *)(plci->fax_connect_info_buffer))->station_id_len = 0; |
@@ -6844,7 +6844,7 @@ static void nl_ind(PLCI *plci) | |||
6844 | if ((plci->requested_options_conn | plci->requested_options | a->requested_options_table[plci->appl->Id-1]) | 6844 | if ((plci->requested_options_conn | plci->requested_options | a->requested_options_table[plci->appl->Id-1]) |
6845 | & ((1L << PRIVATE_FAX_SUB_SEP_PWD) | (1L << PRIVATE_FAX_NONSTANDARD))) | 6845 | & ((1L << PRIVATE_FAX_SUB_SEP_PWD) | (1L << PRIVATE_FAX_NONSTANDARD))) |
6846 | { | 6846 | { |
6847 | i = ((word)(((T30_INFO *) 0)->station_id + 20)) + ((T30_INFO *)plci->NL.RBuffer->P)->head_line_len; | 6847 | i = offsetof(T30_INFO, station_id) + 20 + ((T30_INFO *)plci->NL.RBuffer->P)->head_line_len; |
6848 | while (i < plci->NL.RBuffer->length) | 6848 | while (i < plci->NL.RBuffer->length) |
6849 | plci->ncpi_buffer[++len] = plci->NL.RBuffer->P[i++]; | 6849 | plci->ncpi_buffer[++len] = plci->NL.RBuffer->P[i++]; |
6850 | } | 6850 | } |
@@ -7236,7 +7236,7 @@ static void nl_ind(PLCI *plci) | |||
7236 | { | 7236 | { |
7237 | plci->RData[1].P = plci->RData[0].P; | 7237 | plci->RData[1].P = plci->RData[0].P; |
7238 | plci->RData[1].PLength = plci->RData[0].PLength; | 7238 | plci->RData[1].PLength = plci->RData[0].PLength; |
7239 | plci->RData[0].P = v120_header_buffer + (-((int) v120_header_buffer) & 3); | 7239 | plci->RData[0].P = v120_header_buffer + (-((unsigned long)v120_header_buffer) & 3); |
7240 | if ((plci->NL.RBuffer->P[0] & V120_HEADER_EXTEND_BIT) || (plci->NL.RLength == 1)) | 7240 | if ((plci->NL.RBuffer->P[0] & V120_HEADER_EXTEND_BIT) || (plci->NL.RLength == 1)) |
7241 | plci->RData[0].PLength = 1; | 7241 | plci->RData[0].PLength = 1; |
7242 | else | 7242 | else |
@@ -8473,7 +8473,7 @@ static word add_b23(PLCI *plci, API_PARSE *bp) | |||
8473 | fax_control_bits |= T30_CONTROL_BIT_ACCEPT_SEL_POLLING; | 8473 | fax_control_bits |= T30_CONTROL_BIT_ACCEPT_SEL_POLLING; |
8474 | } | 8474 | } |
8475 | len = nlc[0]; | 8475 | len = nlc[0]; |
8476 | pos = ((byte)(((T30_INFO *) 0)->station_id + 20)); | 8476 | pos = offsetof(T30_INFO, station_id) + 20; |
8477 | if (pos < plci->fax_connect_info_length) | 8477 | if (pos < plci->fax_connect_info_length) |
8478 | { | 8478 | { |
8479 | for (i = 1 + plci->fax_connect_info_buffer[pos]; i != 0; i--) | 8479 | for (i = 1 + plci->fax_connect_info_buffer[pos]; i != 0; i--) |
@@ -8525,7 +8525,7 @@ static word add_b23(PLCI *plci, API_PARSE *bp) | |||
8525 | } | 8525 | } |
8526 | 8526 | ||
8527 | PUT_WORD(&(((T30_INFO *)&nlc[1])->control_bits_low), fax_control_bits); | 8527 | PUT_WORD(&(((T30_INFO *)&nlc[1])->control_bits_low), fax_control_bits); |
8528 | len = ((byte)(((T30_INFO *) 0)->station_id + 20)); | 8528 | len = offsetof(T30_INFO, station_id) + 20; |
8529 | for (i = 0; i < len; i++) | 8529 | for (i = 0; i < len; i++) |
8530 | plci->fax_connect_info_buffer[i] = nlc[1+i]; | 8530 | plci->fax_connect_info_buffer[i] = nlc[1+i]; |
8531 | ((T30_INFO *) plci->fax_connect_info_buffer)->head_line_len = 0; | 8531 | ((T30_INFO *) plci->fax_connect_info_buffer)->head_line_len = 0; |
diff --git a/drivers/isdn/hisax/amd7930_fn.c b/drivers/isdn/hisax/amd7930_fn.c index bf526a7a63af..d6fdf1f66754 100644 --- a/drivers/isdn/hisax/amd7930_fn.c +++ b/drivers/isdn/hisax/amd7930_fn.c | |||
@@ -594,6 +594,7 @@ Amd7930_l1hw(struct PStack *st, int pr, void *arg) | |||
594 | if (cs->debug & L1_DEB_WARN) | 594 | if (cs->debug & L1_DEB_WARN) |
595 | debugl1(cs, "Amd7930: l1hw: l2l1 tx_skb exist this shouldn't happen"); | 595 | debugl1(cs, "Amd7930: l1hw: l2l1 tx_skb exist this shouldn't happen"); |
596 | skb_queue_tail(&cs->sq, skb); | 596 | skb_queue_tail(&cs->sq, skb); |
597 | spin_unlock_irqrestore(&cs->lock, flags); | ||
597 | break; | 598 | break; |
598 | } | 599 | } |
599 | if (cs->debug & DEB_DLOG_HEX) | 600 | if (cs->debug & DEB_DLOG_HEX) |
diff --git a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c index 018bd293e580..0b0c2e5d806b 100644 --- a/drivers/isdn/hisax/diva.c +++ b/drivers/isdn/hisax/diva.c | |||
@@ -382,7 +382,7 @@ MemwaitforXFW(struct IsdnCardState *cs, int hscx) | |||
382 | { | 382 | { |
383 | int to = 50; | 383 | int to = 50; |
384 | 384 | ||
385 | while ((!(MemReadHSCX(cs, hscx, HSCX_STAR) & 0x44) == 0x40) && to) { | 385 | while (((MemReadHSCX(cs, hscx, HSCX_STAR) & 0x44) != 0x40) && to) { |
386 | udelay(1); | 386 | udelay(1); |
387 | to--; | 387 | to--; |
388 | } | 388 | } |
diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c index 9de54202c90c..a420b64472e3 100644 --- a/drivers/isdn/hisax/hfc_usb.c +++ b/drivers/isdn/hisax/hfc_usb.c | |||
@@ -817,8 +817,8 @@ collect_rx_frame(usb_fifo * fifo, __u8 * data, int len, int finish) | |||
817 | } | 817 | } |
818 | /* we have a complete hdlc packet */ | 818 | /* we have a complete hdlc packet */ |
819 | if (finish) { | 819 | if (finish) { |
820 | if ((!fifo->skbuff->data[fifo->skbuff->len - 1]) | 820 | if (fifo->skbuff->len > 3 && |
821 | && (fifo->skbuff->len > 3)) { | 821 | !fifo->skbuff->data[fifo->skbuff->len - 1]) { |
822 | 822 | ||
823 | if (fifon == HFCUSB_D_RX) { | 823 | if (fifon == HFCUSB_D_RX) { |
824 | DBG(HFCUSB_DBG_DCHANNEL, | 824 | DBG(HFCUSB_DBG_DCHANNEL, |
diff --git a/drivers/isdn/hisax/hscx_irq.c b/drivers/isdn/hisax/hscx_irq.c index 7b1ad5e4ecda..2387d76c721a 100644 --- a/drivers/isdn/hisax/hscx_irq.c +++ b/drivers/isdn/hisax/hscx_irq.c | |||
@@ -32,7 +32,7 @@ waitforXFW(struct IsdnCardState *cs, int hscx) | |||
32 | { | 32 | { |
33 | int to = 50; | 33 | int to = 50; |
34 | 34 | ||
35 | while ((!(READHSCX(cs, hscx, HSCX_STAR) & 0x44) == 0x40) && to) { | 35 | while (((READHSCX(cs, hscx, HSCX_STAR) & 0x44) != 0x40) && to) { |
36 | udelay(1); | 36 | udelay(1); |
37 | to--; | 37 | to--; |
38 | } | 38 | } |
diff --git a/drivers/isdn/hisax/icc.c b/drivers/isdn/hisax/icc.c index 9aba646ba221..c80cbb8a2ef9 100644 --- a/drivers/isdn/hisax/icc.c +++ b/drivers/isdn/hisax/icc.c | |||
@@ -468,6 +468,7 @@ ICC_l1hw(struct PStack *st, int pr, void *arg) | |||
468 | if (cs->debug & L1_DEB_WARN) | 468 | if (cs->debug & L1_DEB_WARN) |
469 | debugl1(cs, " l2l1 tx_skb exist this shouldn't happen"); | 469 | debugl1(cs, " l2l1 tx_skb exist this shouldn't happen"); |
470 | skb_queue_tail(&cs->sq, skb); | 470 | skb_queue_tail(&cs->sq, skb); |
471 | spin_unlock_irqrestore(&cs->lock, flags); | ||
471 | break; | 472 | break; |
472 | } | 473 | } |
473 | if (cs->debug & DEB_DLOG_HEX) | 474 | if (cs->debug & DEB_DLOG_HEX) |
diff --git a/drivers/isdn/mISDN/stack.c b/drivers/isdn/mISDN/stack.c index 3e1532a180ff..0d05ec43012c 100644 --- a/drivers/isdn/mISDN/stack.c +++ b/drivers/isdn/mISDN/stack.c | |||
@@ -364,7 +364,7 @@ add_layer2(struct mISDNchannel *ch, struct mISDNstack *st) | |||
364 | static int | 364 | static int |
365 | st_own_ctrl(struct mISDNchannel *ch, u_int cmd, void *arg) | 365 | st_own_ctrl(struct mISDNchannel *ch, u_int cmd, void *arg) |
366 | { | 366 | { |
367 | if (!ch->st || ch->st->layer1) | 367 | if (!ch->st || !ch->st->layer1) |
368 | return -EINVAL; | 368 | return -EINVAL; |
369 | return ch->st->layer1->ctrl(ch->st->layer1, cmd, arg); | 369 | return ch->st->layer1->ctrl(ch->st->layer1, cmd, arg); |
370 | } | 370 | } |