]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC 322270: Fix a NULL pointer dereference in mly_user_command().
authorjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 20 Sep 2017 20:48:21 +0000 (20:48 +0000)
committerjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 20 Sep 2017 20:48:21 +0000 (20:48 +0000)
commiteb914ecf5ac3515d2025e083e2f0d0f9e84a104a
tree379c4936859af42f12b986d44cacf7180183069e
parentb572c42e386c12e0d10785d0f4af1eabd05ca39b
MFC 322270: Fix a NULL pointer dereference in mly_user_command().

If mly_user_command fails to allocate a command slot it jumps to an 'out'
label used for error handling.  The error handling code checks for a data
buffer in 'mc->mc_data' to free before checking if 'mc' is NULL.  Fix by
just returning directly if we fail to allocate a command and only using
the 'out' label for subsequent errors when there is actual cleanup to
perform.

PR: 217747
Reported by: PVS-Studio

git-svn-id: svn://svn.freebsd.org/base/stable/10@323826 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/dev/mly/mly.c