2021-11-07 20:31:34

by Luiz Sampaio

[permalink] [raw]
Subject: [PATCH 0/2] Fixing bug that would segmentation fault

This series of patches consists of one patch fixing a simple coding style
issue and one patch fixing a bug that would cause segmentation fault.
Basically, there was a pointer that was being dereferenced without testing
if the pointer exists. This patch adds a protection, returning EFAULT in
case the pointer is NULL.

Luiz Sampaio (2):
auxdisplay: charlcd: fixing coding style issue
auxdisplay: charlcd: checking for pointer reference before
dereferencing

drivers/auxdisplay/charlcd.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

--
2.33.1


2021-11-07 15:03:16

by Luiz Sampaio

[permalink] [raw]
Subject: [PATCH 1/2] auxdisplay: charlcd: fixing coding style issue

Removing 'int' from 'unsigned long int' declaration, which is unnecessary.

Signed-off-by: Luiz Sampaio <[email protected]>
---
drivers/auxdisplay/charlcd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c
index 304accde365c..cca3b600c0ba 100644
--- a/drivers/auxdisplay/charlcd.c
+++ b/drivers/auxdisplay/charlcd.c
@@ -37,7 +37,7 @@ struct charlcd_priv {
bool must_clear;

/* contains the LCD config state */
- unsigned long int flags;
+ unsigned long flags;

/* Current escape sequence and it's length or -1 if outside */
struct {
--
2.33.1