1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-03-09 15:40:20 +00:00
openmptcprouter/6.12/target/linux/bcm27xx/patches-6.12/950-0562-misc-rp1-pio-Fix-parameter-checks-wihout-client.patch
Ycarus (Yannick Chabanois) bdb9b0046f Add bcm27xx 6.12 test support
2024-12-20 14:17:26 +01:00

25 lines
840 B
Diff

From 5268150b90286d326f3b5deef0228de8326f501a Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Mon, 25 Nov 2024 21:51:13 +0000
Subject: [PATCH 562/697] 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 <phil@raspberrypi.com>
---
include/linux/pio_rp1.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/include/linux/pio_rp1.h
+++ b/include/linux/pio_rp1.h
@@ -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; })