From: Daniel Vetter <daniel@ffwll.ch>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/fb_helper: Use add_one_connector in add_all_connectors.
Date: Mon, 15 Feb 2016 15:26:49 +0100 [thread overview]
Message-ID: <20160215142649.GL11240@phenom.ffwll.local> (raw)
In-Reply-To: <1455540316-17066-2-git-send-email-maarten.lankhorst@linux.intel.com>
On Mon, Feb 15, 2016 at 01:45:16PM +0100, Maarten Lankhorst wrote:
> add_all_connectors doesn't checks whether reallocation is needed, but add_one does.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Both applied to drm-misc, thanks.
-Daniel
> ---
> drivers/gpu/drm/drm_fb_helper.c | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index 0893b82ce588..855108e6e1bd 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -104,21 +104,17 @@ int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper)
> {
> struct drm_device *dev = fb_helper->dev;
> struct drm_connector *connector;
> - int i;
> + int i, ret;
>
> if (!drm_fbdev_emulation)
> return 0;
>
> mutex_lock(&dev->mode_config.mutex);
> drm_for_each_connector(connector, dev) {
> - struct drm_fb_helper_connector *fb_helper_connector;
> + ret = drm_fb_helper_add_one_connector(fb_helper, connector);
>
> - fb_helper_connector = kzalloc(sizeof(struct drm_fb_helper_connector), GFP_KERNEL);
> - if (!fb_helper_connector)
> + if (ret)
> goto fail;
> -
> - fb_helper_connector->connector = connector;
> - fb_helper->connector_info[fb_helper->connector_count++] = fb_helper_connector;
> }
> mutex_unlock(&dev->mode_config.mutex);
> return 0;
> @@ -130,7 +126,7 @@ fail:
> fb_helper->connector_count = 0;
> mutex_unlock(&dev->mode_config.mutex);
>
> - return -ENOMEM;
> + return ret;
> }
> EXPORT_SYMBOL(drm_fb_helper_single_add_all_connectors);
>
> --
> 2.1.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2016-02-15 14:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-15 12:45 [PATCH 1/2] drm/fb_helper: Use correct allocation count for arrays Maarten Lankhorst
2016-02-15 12:45 ` [PATCH 2/2] drm/fb_helper: Use add_one_connector in add_all_connectors Maarten Lankhorst
2016-02-15 14:26 ` Daniel Vetter [this message]
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=20160215142649.GL11240@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox