net: rmnet_data: Fix potential memory corruption

Fix an out of bounds array access during virtual
net device creation

CRs-fixed: 695032
Change-Id: Ie8ae1f25122f685c22d139d1abf06acf55d46782
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
This commit is contained in:
Subash Abhinov Kasiviswanathan 2014-07-15 20:43:54 -06:00 committed by David Keitel
parent 4d6ec5cecc
commit 5b7b2ca176

View file

@ -561,7 +561,7 @@ int rmnet_vnd_create_dev(int id, struct net_device **new_device,
char dev_prefix[IFNAMSIZ]; char dev_prefix[IFNAMSIZ];
int p, rc = 0; int p, rc = 0;
if (id < 0 || id > RMNET_DATA_MAX_VND) { if (id < 0 || id >= RMNET_DATA_MAX_VND) {
*new_device = 0; *new_device = 0;
return RMNET_CONFIG_BAD_ARGUMENTS; return RMNET_CONFIG_BAD_ARGUMENTS;
} }