Commit a0023bb9 authored by Zheyu Ma's avatar Zheyu Ma Committed by Damien Le Moal
Browse files

ata: sata_mv: Fix the error handling of mv_chip_id()



mv_init_host() propagates the value returned by mv_chip_id() which in turn
gets propagated by mv_pci_init_one() and hits local_pci_probe().

During the process of driver probing, the probe function should return < 0
for failure, otherwise, the kernel will treat value > 0 as success.

Since this is a bug rather than a recoverable runtime error we should
use dev_alert() instead of dev_err().

Signed-off-by: default avatarZheyu Ma <zheyuma97@gmail.com>
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
parent 776c7501
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3896,8 +3896,8 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx)
		break;

	default:
		dev_err(host->dev, "BUG: invalid board index %u\n", board_idx);
		return 1;
		dev_alert(host->dev, "BUG: invalid board index %u\n", board_idx);
		return -EINVAL;
	}

	hpriv->hp_flags = hp_flags;