diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-07-28 18:49:25 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-07-31 16:18:43 -0700 |
commit | a9cf7250ba85427a372225067d57cf3ff4471047 (patch) | |
tree | e0d42f3171b7d61a3c2aa8ea4a45f9afc859cf9b /drivers/staging/rtl8192e | |
parent | d1f0f3118e55ad80136d19dd4afdb32ccba26a42 (diff) |
staging: rtl8192e: don't just print an error and continue
I was looking at how TOTAL_CAM_ENTRY is used and I saw this code. We
print an error but continue writing "EntryNo" to a register as if it
were valid. "EntryNo" is controlled by the user in rtl8192_ioctl() so
it definitely can be invalid. I'm not positive what happens with the
invalid data but it can't be good.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192e')
-rw-r--r-- | drivers/staging/rtl8192e/rtl8192e/rtl_cam.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c index c146b7e720a9..29dd93ac5e93 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c @@ -117,8 +117,10 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex, } } priv->rtllib->is_set_key = true; - if (EntryNo >= TOTAL_CAM_ENTRY) + if (EntryNo >= TOTAL_CAM_ENTRY) { netdev_info(dev, "%s(): Invalid CAM entry\n", __func__); + return; + } RT_TRACE(COMP_SEC, "====>to rtl92e_set_key(), dev:%p, EntryNo:%d, KeyIndex:%d,KeyType:%d, MacAddr %pM\n", |