mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-05-24 10:39:52 +00:00
media: v4l2-fwnode: Avoid using PTR_ERR(NULL)
PTR_ERR(NULL) yields 0 which is commonly used to denote success. This is the case here, and PTR_ERR(NULL) is apparently shunned upon. Fix this by explicitly returning 0 if fwnode == NULL. Reported-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
parent
5c49ac3ac6
commit
4ace2d28ab
1 changed files with 1 additions and 1 deletions
|
@ -1095,7 +1095,7 @@ v4l2_fwnode_reference_parse_int_props(struct device *dev,
|
|||
}
|
||||
}
|
||||
|
||||
return PTR_ERR(fwnode) == -ENOENT ? 0 : PTR_ERR(fwnode);
|
||||
return !fwnode || PTR_ERR(fwnode) == -ENOENT ? 0 : PTR_ERR(fwnode);
|
||||
|
||||
error:
|
||||
fwnode_handle_put(fwnode);
|
||||
|
|
Loading…
Add table
Reference in a new issue