intel_th: Fix a double put_device() in error path
commit 512592779a337feb5905d8fcf9498dbf33672d4a upstream. Commit a753bfcf ("intel_th: Make the switch allocate its subdevices") factored out intel_th_subdevice_alloc() from intel_th_populate(), but got the error path wrong, resulting in two instances of a double put_device() on a freshly initialized, but not 'added' device. Fix this by only doing one put_device() in the error path. Signed-off-by: NAlexander Shishkin <alexander.shishkin@linux.intel.com> Fixes: a753bfcf ("intel_th: Make the switch allocate its subdevices") Reported-by: NWen Yang <wenyang@linux.alibaba.com> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: stable@vger.kernel.org # v4.14+ Link: https://lore.kernel.org/r/20191120130806.44028-2-alexander.shishkin@linux.intel.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing
想要评论请 注册 或 登录