]> git.baikalelectronics.ru Git - kernel.git/commit
s390/vfio-ap: Fix memory allocation for mdev_types array
authorJason J. Herne <jjherne@linux.ibm.com>
Fri, 21 Oct 2022 14:50:02 +0000 (10:50 -0400)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 26 Oct 2022 12:47:31 +0000 (14:47 +0200)
commite47cb17021bd9dc7591969c1c04860a57abc4745
tree0f585f354158156b4aa830987e11c85a0c7bd4ef
parent872550a1badd263d0db51b32affba7a8717f5bc8
s390/vfio-ap: Fix memory allocation for mdev_types array

The vfio-ap crypto driver fails to allocate memory for an array of
pointers used to pass supported mdev types to mdev_register_parent().

Since we only support a single mdev type, the fix is to allocate a
single entry in the ap_matrix_dev->mdev_types array.

Link: https://lore.kernel.org/r/20221021145905.15100-1-jjherne@linux.ibm.com
Fixes: 48b2eb018919 ("vfio/mdev: simplify mdev_type handling")
Cc: stable@vger.kernel.org
Cc: Tony Krowiak <akrowiak@linux.ibm.com>
Reported-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Jason J. Herne <jjherne@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
drivers/s390/crypto/vfio_ap_private.h