diff mbox series

ptp: fix missing break in switch

Message ID 20180718011733.GA27872@embeddedor.com
State Accepted, archived
Delegated to: David Miller
Headers show
Series ptp: fix missing break in switch | expand

Commit Message

Gustavo A. R. Silva July 18, 2018, 1:17 a.m. UTC
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")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/ptp/ptp_chardev.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Richard Cochran July 18, 2018, 3:46 a.m. UTC | #1
On Tue, Jul 17, 2018 at 08:17:33PM -0500, Gustavo A. R. Silva wrote:
> 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.

Acked-by: Richard Cochran <richardcochran@gmail.com>
David Miller July 18, 2018, 10:26 p.m. UTC | #2
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Date: Tue, 17 Jul 2018 20:17:33 -0500

> 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")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Applied and queued up for -stable, thank you.
Gustavo A. R. Silva July 18, 2018, 10:39 p.m. UTC | #3
On 07/18/2018 05:26 PM, David Miller wrote:
> From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
> Date: Tue, 17 Jul 2018 20:17:33 -0500
> 
>> 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")
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> 
> Applied and queued up for -stable, thank you.
> 

Great. Glad to help. :)

Thanks
--
Gustavo
diff mbox series

Patch

diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c
index 547dbda..01b0e2b 100644
--- a/drivers/ptp/ptp_chardev.c
+++ b/drivers/ptp/ptp_chardev.c
@@ -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;
 	}