lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPM=9txErDH+1CvwzRXrdWTkgtoYi_ZeWKAB8vXzvULNQqqRTg@mail.gmail.com>
Date:	Thu, 28 May 2015 13:32:00 +1000
From:	Dave Airlie <airlied@...il.com>
To:	Frediano Ziglio <fziglio@...hat.com>
Cc:	spice-devel <spice-devel@...ts.freedesktop.org>,
	Dave Airlie <airlied@...ux.ie>,
	dri-devel <dri-devel@...ts.freedesktop.org>,
	Dave Airlie <airlied@...hat.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [Spice-devel] [PATCH 10/11] Simplify cleaning qxl processing command

On 27 May 2015 at 20:04, Frediano Ziglio <fziglio@...hat.com> wrote:
> In qxlhw_handle_to_bo we incremented counters twice, one time for release object
> and one for reloc_info.
> In the main function however reloc_info references was drop much earlier than
> release so keeping the pointer only on release is safe and make cleaning
> process easier.

Seems fine,

Reviewed-by: Dave Airlie <airlied@...hat.com>
>
> Signed-off-by: Frediano Ziglio <fziglio@...hat.com>
> ---
>  qxl/qxl_ioctl.c | 13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
>
> diff --git a/qxl/qxl_ioctl.c b/qxl/qxl_ioctl.c
> index 85b3808..bb326ff 100644
> --- a/qxl/qxl_ioctl.c
> +++ b/qxl/qxl_ioctl.c
> @@ -122,10 +122,9 @@ static struct qxl_bo *qxlhw_handle_to_bo(struct qxl_device *qdev,
>         qobj = gem_to_qxl_bo(gobj);
>
>         ret = qxl_release_list_add(release, qobj);
> -       if (ret) {
> -               drm_gem_object_unreference_unlocked(gobj);
> +       drm_gem_object_unreference_unlocked(gobj);
> +       if (ret)
>                 return NULL;
> -       }
>
>         return qobj;
>  }
> @@ -145,7 +144,7 @@ static int qxl_process_single_command(struct qxl_device *qdev,
>         struct qxl_release *release;
>         struct qxl_bo *cmd_bo;
>         void *fb_cmd;
> -       int i, j, ret, num_relocs;
> +       int i, ret, num_relocs;
>         int unwritten;
>
>         switch (cmd->type) {
> @@ -269,12 +268,6 @@ static int qxl_process_single_command(struct qxl_device *qdev,
>                 qxl_release_fence_buffer_objects(release);
>
>  out_free_bos:
> -       for (j = 0; j < num_relocs; j++) {
> -               if (reloc_info[j].dst_bo != cmd_bo)
> -                       drm_gem_object_unreference_unlocked(&reloc_info[j].dst_bo->gem_base);
> -               if (reloc_info[j].src_bo && reloc_info[j].src_bo != cmd_bo)
> -                       drm_gem_object_unreference_unlocked(&reloc_info[j].src_bo->gem_base);
> -       }
>  out_free_release:
>         if (ret)
>                 qxl_release_free(qdev, release);
> --
> 2.1.0
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@...ts.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ