Skip to content

Commit 05678eb

Browse files
committed
misc: rp1-pio: Fix parameter checks wihout client
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]>
1 parent ae98140 commit 05678eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/pio_rp1.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#endif
2121

2222
#define bad_params_if(client, test) \
23-
({ bool f = (test); if (f) pio_set_error(client, -EINVAL); \
23+
({ bool f = (test); if (f && client) pio_set_error(client, -EINVAL); \
2424
if (f && PARAM_WARNINGS_ENABLED) WARN_ON((test)); \
2525
f; })
2626

0 commit comments

Comments
 (0)