lede/target/linux/bcm27xx/patches-6.12/950-0559-misc-rp1-pio-Fix-parameter-checks-wihout-client.patch
=?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= d81c03f05e bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-06-20 17:01:06 +08:00

26 lines
832 B
Diff

From 6d9e463ef0227007060e29b20abacdd50b258543 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Mon, 25 Nov 2024 21:51:13 +0000
Subject: [PATCH] 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; })