From: Shuicheng Lin Date: Thu, 20 Feb 2025 00:17:10 +0000 (+0000) Subject: drm/xe/devcoredump: Remove IS_ERR_OR_NULL check for kzalloc X-Git-Tag: v6.15-rc1~120^2~10^2~88 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=046eda65258ba1e6d9052e3ca07d8e489b6325de;p=thirdparty%2Fkernel%2Fstable.git drm/xe/devcoredump: Remove IS_ERR_OR_NULL check for kzalloc kzalloc returns a valid pointer or NULL if the allocation fails. It never returns an error pointer. It is better to check for NULL directly. Signed-off-by: Shuicheng Lin Cc: John Harrison Cc: Lucas De Marchi Reviewed-by: Tejas Upadhyay Reviewed-by: Jonathan Cavitt Link: https://patchwork.freedesktop.org/patch/msgid/20250220001710.1803749-3-shuicheng.lin@intel.com Signed-off-by: Lucas De Marchi --- diff --git a/drivers/gpu/drm/xe/xe_devcoredump.c b/drivers/gpu/drm/xe/xe_devcoredump.c index 60d15e4550173..81b9d9bb3f57f 100644 --- a/drivers/gpu/drm/xe/xe_devcoredump.c +++ b/drivers/gpu/drm/xe/xe_devcoredump.c @@ -426,8 +426,8 @@ void xe_print_blob_ascii85(struct drm_printer *p, const char *prefix, char suffi drm_printf(p, "Offset not word aligned: %zu", offset); line_buff = kzalloc(DMESG_MAX_LINE_LEN, GFP_KERNEL); - if (IS_ERR_OR_NULL(line_buff)) { - drm_printf(p, "Failed to allocate line buffer: %pe", line_buff); + if (!line_buff) { + drm_printf(p, "Failed to allocate line buffer\n"); return; }