Re: [PATCH 1/1] cpuidle: fix improper return value on error

2016-12-07 Thread Rafael J. Wysocki
On Saturday, December 03, 2016 11:02:27 PM Pan Bian wrote: > From: Pan Bian > > In function cpuidle_add_state_sysfs(), variable ret takes the return > value. Its value should be negative on errors. Because ret is reset in > the loop, its value will be 0 during the second and after repeat of the >

[PATCH 1/1] cpuidle: fix improper return value on error

2016-12-03 Thread Pan Bian
From: Pan Bian In function cpuidle_add_state_sysfs(), variable ret takes the return value. Its value should be negative on errors. Because ret is reset in the loop, its value will be 0 during the second and after repeat of the loop. If kzalloc() returns a NULL pointer then, it will return 0. It m