All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Weinehall <david.weinehall@linux.intel.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: ander.conselvan.de.oliveira@intel.com, intel-gfx@lists.freedesktop.org
Subject: Re: drm/i915: Copy the staged connector config to the legacy atomic state
Date: Mon, 30 Mar 2015 13:50:40 +0300	[thread overview]
Message-ID: <20150330105040.GA7970@boom> (raw)
In-Reply-To: <20150327143640.GA23046@mwanda>

On Fri, Mar 27, 2015 at 05:36:40PM +0300, Dan Carpenter wrote:
> Hello Ander Conselvan de Oliveira,
> 
> This is a semi-automatic email about new static checker warnings.
> 
> The patch 944b0c765757: "drm/i915: Copy the staged connector config 
> to the legacy atomic state" from Mar 20, 2015, leads to the following 
> Smatch complaint:
> 
> drivers/gpu/drm/i915/intel_display.c:9118 intel_release_load_detect_pipe()
> 	 error: we previously assumed 'state' could be null (see line 9082)
> 
> drivers/gpu/drm/i915/intel_display.c
>   9081			state = drm_atomic_state_alloc(dev);
>   9082			if (!state)
>   9083				goto fail;
>                                 ^^^^^^^^^
> Patch changes a return into a goto.
> 
>   9084	
>   9085			state->acquire_ctx = ctx;
>   9086	
>   9087			connector_state = drm_atomic_get_connector_state(state, connector);
>   9088			if (IS_ERR(connector_state))
>   9089				goto fail;
>   9090	
>   9091			to_intel_connector(connector)->new_encoder = NULL;
>   9092			intel_encoder->new_crtc = NULL;
>   9093			intel_crtc->new_enabled = false;
>   9094			intel_crtc->new_config = NULL;
>   9095	
>   9096			connector_state->best_encoder = NULL;
>   9097			connector_state->crtc = NULL;
>   9098	
>   9099			intel_set_mode(crtc, NULL, 0, 0, NULL, state);
>   9100	
>   9101			drm_atomic_state_free(state);
>   9102	
>   9103			if (old->release_fb) {
>   9104				drm_framebuffer_unregister_private(old->release_fb);
>   9105				drm_framebuffer_unreference(old->release_fb);
>   9106			}
>   9107	
>   9108			return;
>   9109		}
>   9110	
>   9111		/* Switch crtc and encoder back off if necessary */
>   9112		if (old->dpms_mode != DRM_MODE_DPMS_ON)
>   9113			connector->funcs->dpms(connector, old->dpms_mode);
>   9114	
>   9115		return;
>   9116	fail:
>   9117		DRM_DEBUG_KMS("Couldn't release load detect pipe.\n");
>   9118		drm_atomic_state_free(state);
>                                       ^^^^^
> Dereferenced inside function call.
> 
>   9119	}
>   9120	

Wouldn't it make more sense to make drm_atomic_state_free() follow
the same semantics as *free() functions typically do
(no operation performed)?


Kind regards, David Weinehall
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2015-03-30 10:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-27 14:36 drm/i915: Copy the staged connector config to the legacy atomic state Dan Carpenter
2015-03-30  7:59 ` Ander Conselvan De Oliveira
2015-03-30 10:50 ` David Weinehall [this message]
2015-03-30 11:03   ` Ander Conselvan De Oliveira
2015-03-30 12:02   ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2015-03-27 13:15 Dan Carpenter
2015-03-27 13:35 ` Ander Conselvan De Oliveira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150330105040.GA7970@boom \
    --to=david.weinehall@linux.intel.com \
    --cc=ander.conselvan.de.oliveira@intel.com \
    --cc=dan.carpenter@oracle.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.