Skip to content
Commit cae1d5b7 authored by Marc Kleine-Budde's avatar Marc Kleine-Budde
Browse files

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: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 62c04647
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment