Re: [PATCH 1/2 net] ptp: fix error codes in ptp_clock_register()

2017-07-10 Thread Richard Cochran
On Mon, Jul 10, 2017 at 01:29:20PM +0300, Dan Carpenter wrote: > The "goto no_pps" was a bug you introduced. I took a second look, and yes, the original commit should not have returned NULL, and the original callers did not expect NULL either. > But I feel like you're being rude, so I'm not goin

Re: [PATCH 1/2 net] ptp: fix error codes in ptp_clock_register()

2017-07-10 Thread Dan Carpenter
On Mon, Jul 10, 2017 at 11:48:06AM +0200, Richard Cochran wrote: > On Mon, Jul 10, 2017 at 12:38:16PM +0300, Dan Carpenter wrote: > > There were two buggy commits so I chose the ealier one. The other buggy > > No, you are mistaken. In the original patch, NULL or PTR_ERR were > returned on error,

Re: [PATCH 1/2 net] ptp: fix error codes in ptp_clock_register()

2017-07-10 Thread Richard Cochran
On Mon, Jul 10, 2017 at 12:38:16PM +0300, Dan Carpenter wrote: > There were two buggy commits so I chose the ealier one. The other buggy No, you are mistaken. In the original patch, NULL or PTR_ERR were returned on error, and that was not a bug. If you want to correct the present version of ptp

Re: [PATCH 1/2 net] ptp: fix error codes in ptp_clock_register()

2017-07-10 Thread Dan Carpenter
On Mon, Jul 10, 2017 at 11:21:03AM +0200, Richard Cochran wrote: > On Mon, Jul 10, 2017 at 10:11:37AM +0300, Dan Carpenter wrote: > > The ptp_clock_register() function returns NULL when it's #ifdefed out > > because CONFIG_PTP_1588_CLOCK is disabled. Otherwise, it's intended to > > return error po

Re: [PATCH 1/2 net] ptp: fix error codes in ptp_clock_register()

2017-07-10 Thread Richard Cochran
On Mon, Jul 10, 2017 at 10:11:37AM +0300, Dan Carpenter wrote: > The ptp_clock_register() function returns NULL when it's #ifdefed out > because CONFIG_PTP_1588_CLOCK is disabled. Otherwise, it's intended to > return error pointers. Unfortunately, there are a couple paths where we > forget to set

Re: [PATCH 1/2 net] ptp: fix error codes in ptp_clock_register()

2017-07-10 Thread Richard Cochran
On Mon, Jul 10, 2017 at 10:11:37AM +0300, Dan Carpenter wrote: > The ptp_clock_register() function returns NULL when it's #ifdefed out > because CONFIG_PTP_1588_CLOCK is disabled. Otherwise, it's intended to > return error pointers. Unfortunately, there are a couple paths where we > forget to set

[PATCH 1/2 net] ptp: fix error codes in ptp_clock_register()

2017-07-10 Thread Dan Carpenter
The ptp_clock_register() function returns NULL when it's #ifdefed out because CONFIG_PTP_1588_CLOCK is disabled. Otherwise, it's intended to return error pointers. Unfortunately, there are a couple paths where we forget to set the error code. It means that we could result in NULL pointer derefer