Bug 80411

Summary: char/dsp56k.c:386: pointless code ?
Product: Drivers Reporter: David Binderman (dcb314)
Component: OtherAssignee: drivers_other
Status: NEW ---    
Severity: low CC: andrey_utkin
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.16-rc5 Subsystem:
Regression: No Bisected commit-id:

Description David Binderman 2014-07-16 20:27:55 UTC
[linux-3.16-rc5/drivers/char/dsp56k.c:386]: (style) Checking if unsigned variable 'arg' is less than zero.

Source code is

            if (arg > 31 || arg < 0)
                return -EINVAL;

But

static long dsp56k_ioctl(struct file *file, unsigned int cmd,
             unsigned long arg)

Suggest new code

            if (arg > 31)
                return -EINVAL;
Comment 1 Andrey Utkin 2014-07-17 12:21:10 UTC
Thanks, patch submitted: https://patchwork.kernel.org/patch/4574851/