Commit 43a4166
net: mscc: ocelot: perform error cleanup in ocelot_hwstamp_set()
An unsupported RX filter will leave the port with TX timestamping still
applied as per the new request, rather than the old setting. When
parsing the tx_type, don't apply it just yet, but delay that until after
we've parsed the rx_filter as well (and potentially returned -ERANGE for
that).
Similarly, copy_to_user() may fail, which is a rare occurrence, but
should still be treated by unwinding what was done.
Fixes: 96ca08c ("net: mscc: ocelot: set up traps for PTP packets")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20241205145519.1236778-6-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent b454abf commit 43a4166
1 file changed
+42
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
497 | 497 | | |
498 | 498 | | |
499 | 499 | | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
500 | 522 | | |
501 | 523 | | |
502 | 524 | | |
| |||
523 | 545 | | |
524 | 546 | | |
525 | 547 | | |
| 548 | + | |
526 | 549 | | |
527 | 550 | | |
| 551 | + | |
528 | 552 | | |
529 | 553 | | |
530 | 554 | | |
531 | 555 | | |
532 | 556 | | |
533 | 557 | | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
550 | 561 | | |
551 | 562 | | |
552 | 563 | | |
| |||
571 | 582 | | |
572 | 583 | | |
573 | 584 | | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
574 | 588 | | |
575 | 589 | | |
576 | 590 | | |
577 | 591 | | |
| 592 | + | |
| 593 | + | |
578 | 594 | | |
579 | 595 | | |
580 | | - | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
581 | 606 | | |
582 | 607 | | |
583 | 608 | | |
| |||
0 commit comments