From: dingtianhong Date: Wed, 12 Feb 2014 06:58:50 +0000 (+0800) Subject: bonding: remove the redundant judgements for bond_option_queue_id_set() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c313c89edb93eeac0646dcc6d6cb7fb404d4056d;p=linux-beck.git bonding: remove the redundant judgements for bond_option_queue_id_set() The dev_valid_name() will check the buffer length for input name, no need to check it twice. Cc: Jay Vosburgh Cc: Veaceslav Falico Cc: Andy Gospodarek Signed-off-by: Ding Tianhong Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller --- diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c index 11cb943222d5..832d6e90b1b9 100644 --- a/drivers/net/bonding/bond_options.c +++ b/drivers/net/bonding/bond_options.c @@ -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;