summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Hartkopp <socketcan@hartkopp.net>2012-11-26 22:24:23 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-12-03 11:47:10 -0800
commitc9fa3f41a91e5c279968e5c9962b578aca003c98 (patch)
tree25e582885cd27b3e14e6601c7e9c4c5152b25d05
parent5e937c8ffe7d6ba56a699684a4bc5f6b3edd05a5 (diff)
downloadlinux-3.10-c9fa3f41a91e5c279968e5c9962b578aca003c98.tar.gz
linux-3.10-c9fa3f41a91e5c279968e5c9962b578aca003c98.tar.bz2
linux-3.10-c9fa3f41a91e5c279968e5c9962b578aca003c98.zip
can: bcm: initialize ifindex for timeouts without previous frame reception
commit 81b401100c01d2357031e874689f89bd788d13cd upstream. Set in the rx_ifindex to pass the correct interface index in the case of a message timeout detection. Usually the rx_ifindex value is set at receive time. But when no CAN frame has been received the RX_TIMEOUT notification did not contain a valid value. Reported-by: Andre Naujoks <nautsch2@googlemail.com> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/can/bcm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/can/bcm.c b/net/can/bcm.c
index 151b7730c12..3910c1fefd0 100644
--- a/net/can/bcm.c
+++ b/net/can/bcm.c
@@ -1084,6 +1084,9 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
op->sk = sk;
op->ifindex = ifindex;
+ /* ifindex for timeout events w/o previous frame reception */
+ op->rx_ifindex = ifindex;
+
/* initialize uninitialized (kzalloc) structure */
hrtimer_init(&op->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
op->timer.function = bcm_rx_timeout_handler;