Currently an allocation is being made but the allocation failure
check is being performed on another pointer. Fix this by checking
the correct pointer. Also use the normal kernel idiom for null
pointer checks.
Addresses-Coverity: ("Resource leak")
Fixes:
43e3ac8389ef ("drm/amd/display: Add function to copy DC streams")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
struct dc_stream_state *new_stream;
new_stream = kzalloc(sizeof(struct dc_stream_state), GFP_KERNEL);
- if (stream == NULL)
+ if (!new_stream)
return NULL;
memcpy(new_stream, stream, sizeof(struct dc_stream_state));