ptp: Fix pass zero to ERR_PTR() in ptp_clock_register
authorYueHaibing <yuehaibing@huawei.com>
Fri, 23 Nov 2018 01:54:55 +0000 (09:54 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 18:47:01 +0000 (19:47 +0100)
commit3b07abf1cedffca88b51a116657a3a149935fc76
treeb2d1520036bdc4df8298fb87a1858c8f3296ac91
parent2dbfc1cdb68a280227c9e90f265ecd1ddf30df1c
ptp: Fix pass zero to ERR_PTR() in ptp_clock_register

[ Upstream commit aea0a897af9e44c258e8ab9296fad417f1bc063a ]

Fix smatch warning:

drivers/ptp/ptp_clock.c:298 ptp_clock_register() warn:
 passing zero to 'ERR_PTR'

'err' should be set while device_create_with_groups and
pps_register_source fails

Fixes: 85a66e550195 ("ptp: create "pins" together with the rest of attributes")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/ptp/ptp_clock.c