mirror of
https://github.com/torvalds/linux.git
synced 2026-03-13 23:46:14 +01:00
drm/tiny: sharp-memory: fix pointer error dereference
The function devm_drm_dev_alloc() returns a pointer error upon failure
not NULL. Change null check to pointer error check.
Detected by Smatch:
drivers/gpu/drm/tiny/sharp-memory.c:549 sharp_memory_probe() error:
'smd' dereferencing possible ERR_PTR()
Fixes: b8f9f21716 ("drm/tiny: Add driver for Sharp Memory LCD")
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/20260216040438.43702-1-ethantidmore06@gmail.com
This commit is contained in:
parent
9478c166c4
commit
46120745bb
1 changed files with 2 additions and 2 deletions
|
|
@ -541,8 +541,8 @@ static int sharp_memory_probe(struct spi_device *spi)
|
|||
|
||||
smd = devm_drm_dev_alloc(dev, &sharp_memory_drm_driver,
|
||||
struct sharp_memory_device, drm);
|
||||
if (!smd)
|
||||
return -ENOMEM;
|
||||
if (IS_ERR(smd))
|
||||
return PTR_ERR(smd);
|
||||
|
||||
spi_set_drvdata(spi, smd);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue