appledisplay: fix error handling in the scheduled work
authorOliver Neukum <oneukum@suse.com>
Wed, 6 Nov 2019 12:49:01 +0000 (13:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Nov 2019 17:29:05 +0000 (18:29 +0100)
commit28b06dc3e53970fe82ee1e5b8bbc74cb73f08909
treea929a4e95b8d2d75b41684a9ae504a0efeddc2a6
parent8836f9ccf3c93c1e41a4d6e7d1dc16e933abc837
appledisplay: fix error handling in the scheduled work

commit 91feb01596e5efc0cc922cc73f5583114dccf4d2 upstream.

The work item can operate on

1. stale memory left over from the last transfer
the actual length of the data transfered needs to be checked
2. memory already freed
the error handling in appledisplay_probe() needs
to cancel the work in that case

Reported-and-tested-by: syzbot+495dab1f175edc9c2f13@syzkaller.appspotmail.com
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20191106124902.7765-1-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/appledisplay.c