On 27.11.23 13:57, Dan Carpenter wrote:
The error code needs to be set on these error paths. Fixes: 5dd9ad32d775 ("xen/events: drop xen_allocate_irqs_dynamic()") Fixes: d2ba3166f23b ("xen/events: move drivers/xen/events.c into drivers/xen/events/")
Please drop the last Fixes: tag. Said patch didn't introduce any new problem.
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> --- Are we going to backport these to stable? Should I split this into two patches? drivers/xen/events/events_base.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c index f5edb9e27e3c..aae62603b461 100644 --- a/drivers/xen/events/events_base.c +++ b/drivers/xen/events/events_base.c @@ -1105,13 +1105,17 @@ int xen_bind_pirq_msi_to_irq(struct pci_dev *dev, struct msi_desc *msidesc, mutex_lock(&irq_mapping_update_lock);irq = irq_alloc_descs(-1, 0, nvec, -1);- if (irq < 0) + if (irq < 0) { + ret = irq; goto out; + }
Why? The return value for the out: label is in irq.
for (i = 0; i < nvec; i++) {info = xen_irq_init(irq + i); - if (!info) + if (!info) { + ret = -ENOMEM; goto error_irq; + }
It would be easier to just preset ret with -ENOMEM when defining it. Juergen
Attachment:
OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key
Attachment:
OpenPGP_signature.asc
Description: OpenPGP digital signature