From: Chris Wilson Date: Fri, 17 Mar 2017 20:53:17 +0000 (+0000) Subject: drm/i915: Correct error handling for i915_gem_object_create_from_data() X-Git-Tag: MMI-PSA29.97-13-9~5363^2~31^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f3ddd2c14fdc08798a7fa2d32b39786585162f50;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git drm/i915: Correct error handling for i915_gem_object_create_from_data() i915_gem_object_create_from_data() always returns an error pointer on failure, there is no need to check against NULL. Signed-off-by: Chris Wilson Link: http://patchwork.freedesktop.org/patch/msgid/20170317205317.7885-1-chris@chris-wilson.co.uk Reviewed-by: Matthew Auld --- diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c index 86530c92337a..d15a7d9d4eb0 100644 --- a/drivers/gpu/drm/i915/intel_uc.c +++ b/drivers/gpu/drm/i915/intel_uc.c @@ -377,8 +377,8 @@ void intel_uc_prepare_fw(struct drm_i915_private *dev_priv, uc_fw->major_ver_wanted, uc_fw->minor_ver_wanted); obj = i915_gem_object_create_from_data(dev_priv, fw->data, fw->size); - if (IS_ERR_OR_NULL(obj)) { - err = obj ? PTR_ERR(obj) : -ENOMEM; + if (IS_ERR(obj)) { + err = PTR_ERR(obj); goto fail; }