Re: [PATCH weston] compositor-fbdev: fix VT switching crash

2015-08-20 Thread Pekka Paalanen
On Wed, 19 Aug 2015 10:21:07 -0500
Derek Foreman der...@osg.samsung.com wrote:

 Ouch,
 
 Reviewed-by: Derek Foreman der...@osg.samsung.com
 
 On 19/08/15 06:03 AM, Pekka Paalanen wrote:
  From: Pekka Paalanen pekka.paala...@collabora.co.uk
  
  This bug was introduced in 954f183e2f9891b241c1efc0ea61ed56019a4326.
  
  The session_notify() data was accidentally cast to fbdev_backend while
  it is weston_compositor. This was possibly due to the code before the
  mentioned commit casting data directly to fbdev_compositor without going
  through the intended type first, which worked only because
  weston_compositor was the first member in struct fbdev_compositor.
  
  Fix the casts to be the right way around.
  
  Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91654
  Cc: nerdopol...@verizon.net
  Cc: Giulio Camuffo giuliocamu...@gmail.com
  Signed-off-by: Pekka Paalanen pekka.paala...@collabora.co.uk
  ---
   src/compositor-fbdev.c | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)
  
  diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c
  index 051a381..a5c7947 100644
  --- a/src/compositor-fbdev.c
  +++ b/src/compositor-fbdev.c
  @@ -756,8 +756,8 @@ fbdev_backend_destroy(struct weston_compositor *base)
   static void
   session_notify(struct wl_listener *listener, void *data)
   {
  -   struct fbdev_backend *backend = data;
  -   struct weston_compositor *compositor = backend-compositor;
  +   struct weston_compositor *compositor = data;
  +   struct fbdev_backend *backend = to_fbdev_backend(compositor);
  struct weston_output *output;
   
  if (compositor-session_active) {
  

Pushed:
   2b25450..3f89794  master - master


Thanks,
pq


pgpc_fMmcyNJH.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] compositor-fbdev: fix VT switching crash

2015-08-19 Thread Derek Foreman
Ouch,

Reviewed-by: Derek Foreman der...@osg.samsung.com

On 19/08/15 06:03 AM, Pekka Paalanen wrote:
 From: Pekka Paalanen pekka.paala...@collabora.co.uk
 
 This bug was introduced in 954f183e2f9891b241c1efc0ea61ed56019a4326.
 
 The session_notify() data was accidentally cast to fbdev_backend while
 it is weston_compositor. This was possibly due to the code before the
 mentioned commit casting data directly to fbdev_compositor without going
 through the intended type first, which worked only because
 weston_compositor was the first member in struct fbdev_compositor.
 
 Fix the casts to be the right way around.
 
 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91654
 Cc: nerdopol...@verizon.net
 Cc: Giulio Camuffo giuliocamu...@gmail.com
 Signed-off-by: Pekka Paalanen pekka.paala...@collabora.co.uk
 ---
  src/compositor-fbdev.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c
 index 051a381..a5c7947 100644
 --- a/src/compositor-fbdev.c
 +++ b/src/compositor-fbdev.c
 @@ -756,8 +756,8 @@ fbdev_backend_destroy(struct weston_compositor *base)
  static void
  session_notify(struct wl_listener *listener, void *data)
  {
 - struct fbdev_backend *backend = data;
 - struct weston_compositor *compositor = backend-compositor;
 + struct weston_compositor *compositor = data;
 + struct fbdev_backend *backend = to_fbdev_backend(compositor);
   struct weston_output *output;
  
   if (compositor-session_active) {
 

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston] compositor-fbdev: fix VT switching crash

2015-08-19 Thread Pekka Paalanen
From: Pekka Paalanen pekka.paala...@collabora.co.uk

This bug was introduced in 954f183e2f9891b241c1efc0ea61ed56019a4326.

The session_notify() data was accidentally cast to fbdev_backend while
it is weston_compositor. This was possibly due to the code before the
mentioned commit casting data directly to fbdev_compositor without going
through the intended type first, which worked only because
weston_compositor was the first member in struct fbdev_compositor.

Fix the casts to be the right way around.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91654
Cc: nerdopol...@verizon.net
Cc: Giulio Camuffo giuliocamu...@gmail.com
Signed-off-by: Pekka Paalanen pekka.paala...@collabora.co.uk
---
 src/compositor-fbdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c
index 051a381..a5c7947 100644
--- a/src/compositor-fbdev.c
+++ b/src/compositor-fbdev.c
@@ -756,8 +756,8 @@ fbdev_backend_destroy(struct weston_compositor *base)
 static void
 session_notify(struct wl_listener *listener, void *data)
 {
-   struct fbdev_backend *backend = data;
-   struct weston_compositor *compositor = backend-compositor;
+   struct weston_compositor *compositor = data;
+   struct fbdev_backend *backend = to_fbdev_backend(compositor);
struct weston_output *output;
 
if (compositor-session_active) {
-- 
2.4.6

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel