summaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2019-08-15 11:30:50 +0300
committerThomas Hellstrom <thellstrom@vmware.com>2019-09-05 14:44:28 +0200
commit08b0c891605acf727e43e3e03a25857d3e789b61 (patch)
tree16cd884489ffb829e38ff94650adb5f522bdc6c9 /arch/mips
parent6b7c3b86f0b63134b2ab56508921a0853ffa687a (diff)
downloadlinux-stable-08b0c891605acf727e43e3e03a25857d3e789b61.tar.gz
linux-stable-08b0c891605acf727e43e3e03a25857d3e789b61.tar.bz2
linux-stable-08b0c891605acf727e43e3e03a25857d3e789b61.zip
drm/vmwgfx: Fix double free in vmw_recv_msg()
We recently added a kfree() after the end of the loop: if (retries == RETRIES) { kfree(reply); return -EINVAL; } There are two problems. First the test is wrong and because retries equals RETRIES if we succeed on the last iteration through the loop. Second if we fail on the last iteration through the loop then the kfree is a double free. When you're reading this code, please note the break statement at the end of the while loop. This patch changes the loop so that if it's not successful then "reply" is NULL and we can test for that afterward. Cc: <stable@vger.kernel.org> Fixes: 6b7c3b86f0b6 ("drm/vmwgfx: fix memory leak when too many retries have occurred") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Diffstat (limited to 'arch/mips')
0 files changed, 0 insertions, 0 deletions