Skip to content

Commit

Permalink
bonding: remove the redundant judgements for bond_option_queue_id_set()
Browse files Browse the repository at this point in the history
The dev_valid_name() will check the buffer length for input name, no need to
check it twice.

Cc: Jay Vosburgh <fubar@us.ibm.com>
Cc: Veaceslav Falico <vfalico@redhat.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Reviewed-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
dingtianhong authored and David S. Miller committed Feb 13, 2014
1 parent 805d157 commit c313c89
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/bonding/bond_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -1199,8 +1199,7 @@ int bond_option_queue_id_set(struct bonding *bond,
goto err_no_cmd;

/* Check buffer length, valid ifname and queue id */
if (strlen(newval->string) > IFNAMSIZ ||
!dev_valid_name(newval->string) ||
if (!dev_valid_name(newval->string) ||
qid > bond->dev->real_num_tx_queues)
goto err_no_cmd;

Expand Down

0 comments on commit c313c89

Please sign in to comment.