Skip to content

Commit 6f14f49

Browse files
committed
Merge branch 'ieee802154-for-davem-2018-03-29' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan-next
Stefan Schmidt says: ==================== pull-request: ieee802154-next 2018-03-29 An update from ieee802154 for *net-next* Colin fixed a unused variable in the new mcr20a driver. Harry fixed an unitialised data read in the debugfs interface of the ca8210 driver. If there are any issues or you think these are to late for -rc1 (both can also go into -rc2 as they are simple fixes) let me know. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 1dad0f9 + 86674a9 commit 6f14f49

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

drivers/net/ieee802154/ca8210.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2493,13 +2493,14 @@ static ssize_t ca8210_test_int_user_write(
24932493
struct ca8210_priv *priv = filp->private_data;
24942494
u8 command[CA8210_SPI_BUF_SIZE];
24952495

2496-
if (len > CA8210_SPI_BUF_SIZE) {
2496+
memset(command, SPI_IDLE, 6);
2497+
if (len > CA8210_SPI_BUF_SIZE || len < 2) {
24972498
dev_warn(
24982499
&priv->spi->dev,
2499-
"userspace requested erroneously long write (%zu)\n",
2500+
"userspace requested erroneous write length (%zu)\n",
25002501
len
25012502
);
2502-
return -EMSGSIZE;
2503+
return -EBADE;
25032504
}
25042505

25052506
ret = copy_from_user(command, in_buf, len);
@@ -2511,6 +2512,13 @@ static ssize_t ca8210_test_int_user_write(
25112512
);
25122513
return -EIO;
25132514
}
2515+
if (len != command[1] + 2) {
2516+
dev_err(
2517+
&priv->spi->dev,
2518+
"write len does not match packet length field\n"
2519+
);
2520+
return -EBADE;
2521+
}
25142522

25152523
ret = ca8210_test_check_upstream(command, priv->spi);
25162524
if (ret == 0) {

drivers/net/ieee802154/mcr20a.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -723,13 +723,11 @@ mcr20a_set_promiscuous_mode(struct ieee802154_hw *hw, const bool on)
723723
struct mcr20a_local *lp = hw->priv;
724724
int ret;
725725
u8 rx_frame_filter_reg = 0x0;
726-
u8 val;
727726

728727
dev_dbg(printdev(lp), "%s(%d)\n", __func__, on);
729728

730729
if (on) {
731730
/* All frame types accepted*/
732-
val |= DAR_PHY_CTRL4_PROMISCUOUS;
733731
rx_frame_filter_reg &= ~(IAR_RX_FRAME_FLT_FRM_VER);
734732
rx_frame_filter_reg |= (IAR_RX_FRAME_FLT_ACK_FT |
735733
IAR_RX_FRAME_FLT_NS_FT);

0 commit comments

Comments
 (0)