diff options
| -rw-r--r-- | drivers/net/cnic.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c index cfc6b208631a..e503384e2a54 100644 --- a/drivers/net/cnic.c +++ b/drivers/net/cnic.c | |||
| @@ -408,7 +408,7 @@ int cnic_register_driver(int ulp_type, struct cnic_ulp_ops *ulp_ops) | |||
| 408 | { | 408 | { |
| 409 | struct cnic_dev *dev; | 409 | struct cnic_dev *dev; |
| 410 | 410 | ||
| 411 | if (ulp_type >= MAX_CNIC_ULP_TYPE) { | 411 | if (ulp_type < 0 || ulp_type >= MAX_CNIC_ULP_TYPE) { |
| 412 | printk(KERN_ERR PFX "cnic_register_driver: Bad type %d\n", | 412 | printk(KERN_ERR PFX "cnic_register_driver: Bad type %d\n", |
| 413 | ulp_type); | 413 | ulp_type); |
| 414 | return -EINVAL; | 414 | return -EINVAL; |
| @@ -454,7 +454,7 @@ int cnic_unregister_driver(int ulp_type) | |||
| 454 | struct cnic_ulp_ops *ulp_ops; | 454 | struct cnic_ulp_ops *ulp_ops; |
| 455 | int i = 0; | 455 | int i = 0; |
| 456 | 456 | ||
| 457 | if (ulp_type >= MAX_CNIC_ULP_TYPE) { | 457 | if (ulp_type < 0 || ulp_type >= MAX_CNIC_ULP_TYPE) { |
| 458 | printk(KERN_ERR PFX "cnic_unregister_driver: Bad type %d\n", | 458 | printk(KERN_ERR PFX "cnic_unregister_driver: Bad type %d\n", |
| 459 | ulp_type); | 459 | ulp_type); |
| 460 | return -EINVAL; | 460 | return -EINVAL; |
| @@ -510,7 +510,7 @@ static int cnic_register_device(struct cnic_dev *dev, int ulp_type, | |||
| 510 | struct cnic_local *cp = dev->cnic_priv; | 510 | struct cnic_local *cp = dev->cnic_priv; |
| 511 | struct cnic_ulp_ops *ulp_ops; | 511 | struct cnic_ulp_ops *ulp_ops; |
| 512 | 512 | ||
| 513 | if (ulp_type >= MAX_CNIC_ULP_TYPE) { | 513 | if (ulp_type < 0 || ulp_type >= MAX_CNIC_ULP_TYPE) { |
| 514 | printk(KERN_ERR PFX "cnic_register_device: Bad type %d\n", | 514 | printk(KERN_ERR PFX "cnic_register_device: Bad type %d\n", |
| 515 | ulp_type); | 515 | ulp_type); |
| 516 | return -EINVAL; | 516 | return -EINVAL; |
| @@ -551,7 +551,7 @@ static int cnic_unregister_device(struct cnic_dev *dev, int ulp_type) | |||
| 551 | struct cnic_local *cp = dev->cnic_priv; | 551 | struct cnic_local *cp = dev->cnic_priv; |
| 552 | int i = 0; | 552 | int i = 0; |
| 553 | 553 | ||
| 554 | if (ulp_type >= MAX_CNIC_ULP_TYPE) { | 554 | if (ulp_type < 0 || ulp_type >= MAX_CNIC_ULP_TYPE) { |
| 555 | printk(KERN_ERR PFX "cnic_unregister_device: Bad type %d\n", | 555 | printk(KERN_ERR PFX "cnic_unregister_device: Bad type %d\n", |
| 556 | ulp_type); | 556 | ulp_type); |
| 557 | return -EINVAL; | 557 | return -EINVAL; |
