Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e06a03bd authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller
Browse files

fsl/fman: fix the pause_time test



pause_time is unsigned so it can't be less than zero.  The bug means
that we allow invalid pause-times.

Fixes: 57ba4c9b ('fsl/fman: Add FMan MAC support')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 719255d0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -934,7 +934,7 @@ int dtsec_set_tx_pause_frames(struct fman_mac *dtsec,

	/* FM_BAD_TX_TS_IN_B_2_B_ERRATA_DTSEC_A003 Errata workaround */
	if (dtsec->fm_rev_info.major == 2)
		if (pause_time < 0 && pause_time <= 320) {
		if (pause_time <= 320) {
			pr_warn("pause-time: %d illegal.Should be > 320\n",
				pause_time);
			return -EINVAL;