* [patch -next] fsl/fman: fix the pause_time test
@ 2016-01-06 9:58 Dan Carpenter
2016-01-06 20:28 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-01-06 9:58 UTC (permalink / raw)
To: Igal Liberman; +Cc: David S. Miller, netdev, kernel-janitors
pause_time is unsigned so it can't be less than zero. The bug means
that we allow invalid pause-times.
Fixes: 57ba4c9b56d8 ('fsl/fman: Add FMan MAC support')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drivers/net/ethernet/freescale/fman/fman_dtsec.c
index d78e2ba..587f9b4 100644
--- a/drivers/net/ethernet/freescale/fman/fman_dtsec.c
+++ b/drivers/net/ethernet/freescale/fman/fman_dtsec.c
@@ -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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-01-06 20:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-06 9:58 [patch -next] fsl/fman: fix the pause_time test Dan Carpenter
2016-01-06 20:28 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).