]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
net: don't abuse "default" case for unknown ioctl in dev_ifsioc()
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sun, 2 Apr 2023 12:37:49 +0000 (15:37 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Apr 2023 09:04:26 +0000 (10:04 +0100)
commit00d521b39307c3232bdc685c2e9fd82ed973ac24
treeec613d66578dd481813d9444d9b7d56b8aa73c52
parent51aaa68222d6c34f0373cf95223ce2f230329e8f
net: don't abuse "default" case for unknown ioctl in dev_ifsioc()

The "switch (cmd)" block from dev_ifsioc() gained a bit too much
unnecessary manual handling of "cmd" in the "default" case, starting
with the private ioctls.

Clean that up by using the "ellipsis" gcc extension, adding separate
cases for the rest of the ioctls, and letting the default case only
return -EINVAL.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev_ioctl.c