x86/xen: avoid freeing static 'name' when kasprintf() fails
authorVitaly Kuznetsov <vkuznets@redhat.com>
Mon, 5 Jan 2015 15:27:51 +0000 (16:27 +0100)
committerDavid Vrabel <david.vrabel@citrix.com>
Thu, 8 Jan 2015 13:55:25 +0000 (13:55 +0000)
commit7be0772d19103b3eac3c2e9ac325df2563273fdc
tree649728c76fed0d5e0a9766971d9f3376f8eea785
parenta97dae1a2e92e728d28515e88e8eda151f5796f5
x86/xen: avoid freeing static 'name' when kasprintf() fails

In case kasprintf() fails in xen_setup_timer() we assign name to the
static string "<timer kasprintf failed>". We, however, don't check
that fact before issuing kfree() in xen_teardown_timer(), kernel is
supposed to crash with 'kernel BUG at mm/slub.c:3341!'

Solve the issue by making name a fixed length string inside struct
xen_clock_event_device. 16 bytes should be enough.

Suggested-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
arch/x86/xen/time.c