Skip to content

Commit

Permalink
misc: rp1-pio: Fix parameter checks wihout client
Browse files Browse the repository at this point in the history
Passing bad parameters to an API call without a pio pointer will cause
a NULL pointer exception when the persistent error is set. Guard
against that.

Signed-off-by: Phil Elwell <[email protected]>
  • Loading branch information
pelwell committed Nov 25, 2024
1 parent ae98140 commit 05678eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/pio_rp1.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#endif

#define bad_params_if(client, test) \
({ bool f = (test); if (f) pio_set_error(client, -EINVAL); \
({ bool f = (test); if (f && client) pio_set_error(client, -EINVAL); \
if (f && PARAM_WARNINGS_ENABLED) WARN_ON((test)); \
f; })

Expand Down

0 comments on commit 05678eb

Please sign in to comment.