diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2021-12-28 22:46:15 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-12-28 22:46:15 +0300 |
commit | ecf71de775a049cbfa6298deceb8ba2083331171 (patch) | |
tree | 001a722a1677a1773bf809682eaa1c2ed5825b95 /drivers | |
parent | f651faaaba5f41ffac195e64f58483721e60eafc (diff) | |
parent | 4daa9ff89ef27be43c15995412d6aee393a78200 (diff) | |
download | linux-ecf71de775a049cbfa6298deceb8ba2083331171.tar.xz |
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
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/auxdisplay/charlcd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c index 304accde365c..6d309e4971b6 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 { @@ -578,6 +578,9 @@ static int charlcd_init(struct charlcd *lcd) * Since charlcd_init_display() needs to write data, we have to * enable mark the LCD initialized just before. */ + if (WARN_ON(!lcd->ops->init_display)) + return -EINVAL; + ret = lcd->ops->init_display(lcd); if (ret) return ret; |