lkml.org 
[lkml]   [2021]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] regulator: rt4801: Fix NULL pointer dereference if priv->enable_gpios is NULL
Date
Hi, Axel:

Which case will cause this error? I'm not really sure.
But if devm_gpiod_get_array_optional will return null, then it must be check
earlier in probe function

priv->enable_gpios = devm_gpiod_get_array_optional(&i2c->dev, "enable",
GPIOD_OUT_HIGH);
- if (IS_ERR(priv->enable_gpios)) {+ if (IS_ERR_OR_NULL(priv->enable_gpios)) {

If so, this change will be more reasonable.
Cause in binding document, I already write the min item must be '1'.
************* Email Confidentiality Notice ********************

The information contained in this e-mail message (including any attachments) may be confidential, proprietary, privileged, or otherwise exempt from disclosure under applicable laws. It is intended to be conveyed only to the designated recipient(s). Any use, dissemination, distribution, printing, retaining or copying of this e-mail (including its attachments) by unintended recipient(s) is strictly prohibited and may be unlawful. If you are not an intended recipient of this e-mail, or believe that you have received this e-mail in error, please notify the sender immediately (by replying to this e-mail), delete any and all copies of this e-mail (including any attachments) from your system, and do not disclose the content of this e-mail to any other person. Thank you!
\
 
 \ /
  Last update: 2021-06-03 12:41    [W:0.075 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site