Skip to content

Commit ecf71de

Browse files
committed
Merge tag 'auxdisplay-for-linus-v5.16' of git://github.com/ojeda/linux
Pull auxdisplay fixes from Miguel Ojeda: "A couple of improvements for charlcd: - check pointer before dereferencing - fix coding style issue" * tag 'auxdisplay-for-linus-v5.16' of git://github.com/ojeda/linux: auxdisplay: charlcd: checking for pointer reference before dereferencing auxdisplay: charlcd: fixing coding style issue
2 parents f651faa + 4daa9ff commit ecf71de

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/auxdisplay/charlcd.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct charlcd_priv {
3737
bool must_clear;
3838

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

4242
/* Current escape sequence and it's length or -1 if outside */
4343
struct {
@@ -578,6 +578,9 @@ static int charlcd_init(struct charlcd *lcd)
578578
* Since charlcd_init_display() needs to write data, we have to
579579
* enable mark the LCD initialized just before.
580580
*/
581+
if (WARN_ON(!lcd->ops->init_display))
582+
return -EINVAL;
583+
581584
ret = lcd->ops->init_display(lcd);
582585
if (ret)
583586
return ret;

0 commit comments

Comments
 (0)