diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-21 23:20:08 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-21 23:20:08 +0200 |
commit | 3b8a1f45e1b3886593a7cbb0aca09d4d0a9e23df (patch) | |
tree | e9f4ada62ee0d88c7c389cbf66bf2f7ec897c680 /net/atm/lec.c | |
parent | tty:serial_core: Spelling mistake (diff) | |
parent | Linux 5.1-rc6 (diff) | |
download | linux-3b8a1f45e1b3886593a7cbb0aca09d4d0a9e23df.tar.xz linux-3b8a1f45e1b3886593a7cbb0aca09d4d0a9e23df.zip |
Merge 5.1-rc6 into tty-next
We want the serial/tty fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/atm/lec.c')
-rw-r--r-- | net/atm/lec.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/atm/lec.c b/net/atm/lec.c index d7f5cf5b7594..ad4f829193f0 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c @@ -710,7 +710,10 @@ static int lec_vcc_attach(struct atm_vcc *vcc, void __user *arg) static int lec_mcast_attach(struct atm_vcc *vcc, int arg) { - if (arg < 0 || arg >= MAX_LEC_ITF || !dev_lec[arg]) + if (arg < 0 || arg >= MAX_LEC_ITF) + return -EINVAL; + arg = array_index_nospec(arg, MAX_LEC_ITF); + if (!dev_lec[arg]) return -EINVAL; vcc->proto_data = dev_lec[arg]; return lec_mcast_make(netdev_priv(dev_lec[arg]), vcc); @@ -728,6 +731,7 @@ static int lecd_attach(struct atm_vcc *vcc, int arg) i = arg; if (arg >= MAX_LEC_ITF) return -EINVAL; + i = array_index_nospec(arg, MAX_LEC_ITF); if (!dev_lec[i]) { int size; |