Bug 80411 - char/dsp56k.c:386: pointless code ?
Summary: char/dsp56k.c:386: pointless code ?
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 low
Assignee: drivers_other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-16 20:27 UTC by David Binderman
Modified: 2014-07-17 12:21 UTC (History)
1 user (show)

See Also:
Kernel Version: 3.16-rc5
Subsystem:
Regression: No
Bisected commit-id:


Attachments

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/

Note You need to log in before you can comment on or make changes to this bug.