Skip to content

Commit e38de48

Browse files
Jason J. HerneVasily Gorbik
authored andcommitted
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/[email protected] Fixes: da44c34 ("vfio/mdev: simplify mdev_type handling") Cc: [email protected] Cc: Tony Krowiak <[email protected]> Reported-by: Christian Borntraeger <[email protected]> Reviewed-by: Matthew Rosato <[email protected]> Signed-off-by: Jason J. Herne <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent 1b60741 commit e38de48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/s390/crypto/vfio_ap_private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ struct ap_matrix_dev {
5252
struct mutex guests_lock; /* serializes access to each KVM guest */
5353
struct mdev_parent parent;
5454
struct mdev_type mdev_type;
55-
struct mdev_type *mdev_types[];
55+
struct mdev_type *mdev_types[1];
5656
};
5757

5858
extern struct ap_matrix_dev *matrix_dev;

0 commit comments

Comments
 (0)