Skip to contentSkip to conversation

ptp: fix missing break in switch

PATCH In review Gustavo A. R. Silva 3 participants 4 messages Jul 18, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ptp: fix missing break in switch

It seems that a *break* is missing in order to avoid falling through to the default case. Otherwise, checking *chan* makes no sense.

Fixes 72df7a7244c0 ("ptp: Allow reassigning calibration pin function")
---
 drivers/ptp/ptp_chardev.c | 1 +
 1 file changed, 1 insertion(+)
drivers/ptp/ptp_chardev.c +1 -0
index 547dbda..01b0e2b 100644
@@ -89,6 +89,7 @@ int ptp_set_pinfunc(struct ptp_clock *ptp, unsigned int pin,
 	case PTP_PF_PHYSYNC:
 		if (chan != 0)
 			return -EINVAL;
+		break;
 	default:
 		return -EINVAL;
 	}
Signature · 1 line
2.7.4
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Gustavo A. R. Silva

It seems that a *break* is missing in order to avoid falling through to the default case. Otherwise, checking *chan* makes no sense.

Good catch.

#3 lore raw
Quoted 11 lines · David Miller

From: "Gustavo A. R. Silva" <[email protected]>
Date: Tue, 17 Jul 2018 20:17:33 -0500

Quoted 5 lines

It seems that a *break* is missing in order to avoid falling through to the default case. Otherwise, checking *chan* makes no sense.

Fixes 72df7a7244c0 ("ptp: Allow reassigning calibration pin function")

Applied and queued up for -stable, thank you.

Great. Glad to help. :)

Thanks
--
Gustavo