diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index b8f6c309c160ace262e50ea5f2513a3673ce69fc..d24ca5f281b4bbd98e5ce86e8f454c270d86fe10 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -738,8 +738,10 @@ struct pwm_device *pwm_get(struct device *dev, const char *con_id) } } - if (!chosen) + if (!chosen) { + pwm = ERR_PTR(-ENODEV); goto out; + } chip = pwmchip_find_by_name(chosen->provider); if (!chip)