Re: [PATCH v6 2/7] s390: ap: new vfio_ap_queue structure

Pierre Morel
2019-03-28T13:12:19Z

On 25/03/2019 09:05, Harald Freudenberger wrote:
> On 22.03.19 15:43, Pierre Morel wrote:
>> The AP interruptions are assigned on a queue basis and
>> the GISA structure is handled on a VM basis, so that

...snip...

>> + * vfio_ap_queue_dev_remove:
>> + *
>> + * Free the associated vfio_ap_queue structure
>> + */
>> static void vfio_ap_queue_dev_remove(struct ap_device *apdev)
>> {
>> - /* Nothing to do yet */
>> + struct vfio_ap_queue *q;
>> +
>> + q = dev_get_drvdata(&apdev->device);
> I'd add a check if q != NULL here.

I wonder if this can ever happen.
However I added a check in the next patch.
I can move it here.

>> + mutex_lock(&matrix_dev->lock);
>> + list_del(&q->list);
>> + mutex_unlock(&matrix_dev->lock);
>> + kfree(q);
> I would add a line:
>     dev_set_drvdata(&apdev->device, NULL);

OK, I clean it before giving it back, fair.

Thanks.

Rgeards,
Pierre

--
Pierre Morel
Linux/KVM/QEMU in Böblingen - Germany