Pinctrl: Add in zero check
Subsystems (2)
PATCH 1/1 Pinctrl: Add in zero check
add in check of buffer offset to avoid the exception when input 0 size.
--- drivers/pinctrl/pinmux.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/pinctrl/pinmux.c +3 -0
@@ -689,6 +689,9 @@ static ssize_t pinmux_select(struct file *file, const char __user *user_buf,if (len >PINMUX_SELECT_MAX )return -ENOMEM ; +if (len <=0 ) +return -EINVAL ; + buf =kzalloc (PINMUX_SELECT_MAX ,GFP_KERNEL );if (!buf)return -ENOMEM ;
Signature · 1 line
2.18.0
Quoted 3 lines · Will Shiu
add in check of buffer offset to avoid the exception when input 0 size.
Signed-off-by Will Shiu <[email protected]>
Looks good to me, patch applied!
Yours,
Linus Walleij
Quoted 7 lines · Linus Walleij
Quoted 3 lines · Will Shiu
add in check of buffer offset to avoid the exception when input 0 size.
Signed-off-by Will Shiu <[email protected]>Looks good to me, patch applied!
Sorry, but it seems the author didn't pay much attention and didn't really work on it. What does the < 0 comparison mean here?
I would ask if there is _real_ issue with the code? What is the use case and why is this check needed?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 7 lines · Andy Shevchenko
Quoted 6 lines · Linus Walleij
Quoted 3 lines · Will Shiu
add in check of buffer offset to avoid the exception when input 0 size.
Signed-off-by Will Shiu <[email protected]>
Quoted 7 lines
Quoted 1 line
Looks good to me, patch applied!
Sorry, but it seems the author didn't pay much attention and didn't really work on it. What does the < 0 comparison mean here?
I would ask if there is _real_ issue with the code? What is the use case and why is this check needed?
Dropped this until Andy's question is answered.
Yours,
Linus Walleij