]> git.baikalelectronics.ru Git - kernel.git/commit
can: af_can: do not access proto_tab directly use rcu_access_pointer instead
authorMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 17 Oct 2017 05:18:35 +0000 (07:18 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 19 Oct 2017 11:05:53 +0000 (13:05 +0200)
commit6fbf98fce3dd0730873b4ecf2c2669f5581cab09
tree81530dfc1b20ce28497e9a0187a0867c2f070c54
parent65d6a16aee10d97fba9126b123c3f0a27d31e05d
can: af_can: do not access proto_tab directly use rcu_access_pointer instead

"proto_tab" is a RCU protected array, when directly accessing the array,
sparse throws these warnings:

  CHECK   /srv/work/frogger/socketcan/linux/net/can/af_can.c
net/can/af_can.c:115:14: error: incompatible types in comparison expression (different address spaces)
net/can/af_can.c:795:17: error: incompatible types in comparison expression (different address spaces)
net/can/af_can.c:816:9: error: incompatible types in comparison expression (different address spaces)

This patch fixes the problem by using rcu_access_pointer() and
annotating "proto_tab" array as __rcu.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
net/can/af_can.c