summaryrefslogtreecommitdiff
path: root/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
diff options
context:
space:
mode:
authorLv Yunlong <lyl2019@mail.ustc.edu.cn>2021-03-24 13:37:24 +0300
committerWei Liu <wei.liu@kernel.org>2021-03-25 16:31:20 +0300
commit37df9f3fedb6aeaff5564145e8162aab912c9284 (patch)
treed0023f8ac236aa68aa973d30af1b05c3b7492772 /drivers/net/can/usb/peak_usb/pcan_usb_pro.c
parentfe07bfda2fb9cdef8a4d4008a409bb02f35f1bd8 (diff)
downloadlinux-37df9f3fedb6aeaff5564145e8162aab912c9284.tar.xz
video: hyperv_fb: Fix a double free in hvfb_probe
Function hvfb_probe() calls hvfb_getmem(), expecting upon return that info->apertures is either NULL or points to memory that should be freed by framebuffer_release(). But hvfb_getmem() is freeing the memory and leaving the pointer non-NULL, resulting in a double free if an error occurs or later if hvfb_remove() is called. Fix this by removing all kfree(info->apertures) calls in hvfb_getmem(). This will allow framebuffer_release() to free the memory, which follows the pattern of other fbdev drivers. Fixes: 3a6fb6c4255c ("video: hyperv: hyperv_fb: Use physical memory for fb on HyperV Gen 1 VMs.") Signed-off-by: Lv Yunlong <lyl2019@mail.ustc.edu.cn> Reviewed-by: Michael Kelley <mikelley@microsoft.com> Link: https://lore.kernel.org/r/20210324103724.4189-1-lyl2019@mail.ustc.edu.cn Signed-off-by: Wei Liu <wei.liu@kernel.org>
Diffstat (limited to 'drivers/net/can/usb/peak_usb/pcan_usb_pro.c')
0 files changed, 0 insertions, 0 deletions