aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/test_autoload.c
diff options
context:
space:
mode:
authorUwe Kleine-König <[email protected]>2024-03-29 11:07:56 +0100
committerUwe Kleine-König <[email protected]>2024-04-30 18:56:55 +0200
commitc6837aa18016da3e524eb7bb51b8941c1ce8cd73 (patch)
treecde1dbfdae34861481d7f67d5bef5a21b48a37a7 /tools/testing/selftests/bpf/progs/test_autoload.c
parent4c56b1434b814899c42a9d9f43d8265371282cd0 (diff)
pwm: Don't check pointer for being non-NULL after use
After assigning chip = pwm->chip; the compiler is free to assume that pwm is non-NULL and so can optimize out the check for pwm against NULL. While it's probably a programming error to pass a NULL pointer to pwm_put() this shouldn't be dropped without careful consideration and wasn't intended. So assign chip only after the NULL check. Reported-by: David Lechner <[email protected]> Link: https://lore.kernel.org/r/[email protected] Fixes: 4c56b1434b81 ("pwm: Add a struct device to struct pwm_chip") Link: https://lore.kernel.org/r/[email protected] Reviewed-by: David Lechner <[email protected]> Signed-off-by: Uwe Kleine-König <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_autoload.c')
0 files changed, 0 insertions, 0 deletions