thermal: int340x: Check for NULL after calling kmemdup()
As the potential failure of the allocation, kmemdup() may return NULL. Then, 'bin_attr_data_vault.private' will be NULL, but 'bin_attr_data_vault.size' is not 0, which is not consistent. Therefore, it is better to check the return value of kmemdup() to avoid the confusion. Fixes: 0ba13c76 ("thermal/int340x_thermal: Export GDDV") Signed-off-by: NJiasheng Jiang <jiasheng@iscas.ac.cn> [ rjw: Subject and changelog edits ] Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
Showing
想要评论请 注册 或 登录