From: Arkadiusz Kubalewski DPLL's directly connected input pins must not allow the user to use the CONNECTED state. DPLL_MODE_AUTOMATIC only allows SELECTABLE/DISCONNECTED states. The current implementation silently treats CONNECTED as DISCONNECTED instead of rejecting it. Return -EINVAL if the user tries to set DPLL_PIN_STATE_CONNECTED on an input pin. Fixes: d7999f5ea64b ("ice: implement dpll interface to control cgu") Cc: stable@vger.kernel.org Signed-off-by: Arkadiusz Kubalewski Signed-off-by: Aleksandr Loktionov --- drivers/net/ethernet/intel/ice/ice_dpll.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/intel/ice/ice_dpll.c b/drivers/net/ethernet/intel/ice/ice_dpll.c index 397d16c..6a1465f 100644 --- a/drivers/net/ethernet/intel/ice/ice_dpll.c +++ b/drivers/net/ethernet/intel/ice/ice_dpll.c @@ -904,6 +904,8 @@ ice_dpll_input_state_set(const struct dpll_pin *pin, void *pin_priv, { bool enable = state == DPLL_PIN_STATE_SELECTABLE; + if (state == DPLL_PIN_STATE_CONNECTED) + return -EINVAL; return ice_dpll_pin_state_set(pin, pin_priv, dpll, dpll_priv, enable, extack, ICE_DPLL_PIN_TYPE_INPUT); } -- 2.52.0