For FW download ethtool cmd, if the user provides an FW-image incompatible
with the chip, return -EINVAL instead of -1.
Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
        fsec = get_fsec_info(adapter, filehdr_size + img_hdrs_size, fw);
        if (!fsec) {
                dev_err(dev, "Invalid Cookie. FW image may be corrupted\n");
-               return -1;
+               return -EINVAL;
        }
 
        for (i = 0; i < le32_to_cpu(fsec->fsec_hdr.num_images); i++) {
                                                              &flash_cmd,
                                                              num_imgs);
                                else {
-                                       status = -1;
+                                       status = -EINVAL;
                                        dev_err(&adapter->pdev->dev,
                                                "Can't load BE3 UFI on BE3R\n");
                                }
        if (ufi_type == UFI_TYPE2)
                status = be_flash_BEx(adapter, fw, &flash_cmd, 0);
        else if (ufi_type == -1)
-               status = -1;
+               status = -EINVAL;
 
        dma_free_coherent(&adapter->pdev->dev, flash_cmd.size, flash_cmd.va,
                          flash_cmd.dma);