Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1372977pxb; Tue, 17 Aug 2021 10:07:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxopbGdRuhqqKY+ZQjhHoh8872nGmvGRePEFJa6ZjCcqXaoxvhYDrbGj+37j9pvDV9Aj2jm X-Received: by 2002:a5d:508d:: with SMTP id a13mr5515187wrt.172.1629220040273; Tue, 17 Aug 2021 10:07:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629220040; cv=none; d=google.com; s=arc-20160816; b=r7SgKxTd+jYqzxYPkaV0n/1NXjFUKWhY7N8hxi1zCmh/5eN1ONPW8tpyHiARh716YB T3jO1tblo4zgRplckfALnEZe/O7LUcOPETNSYn4z93/ZlafF47yrA6VMuN0akYtlWhMg udeR2c6rnoS7/p2rfv7BBVFSqDg9vHmOoDbW6uy/QfQpL4hYOiNqyo/paHb68WWG44/0 v0b15j2uc+xMKApNfDIcuW+3tYw3g0cFA8z5bKNHXK1RsYqxrXyS2yeq3AulGSBXaeNf EzKFtEdNQ2OzDTnMmAchYC3Ro4Nz9+i5x3rbWTUXwaOUOd2C5c7Mk96DWkg7Zs6dkMwR 9oGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=74Z3GwaGrI/6L9131Hr1UbUOb6HfxaEgTCmH3K6poSk=; b=QhkfniLyurhQO9HYfpZi0n8ggL9Knwyl38PAfCEYlTw70TgR05GXCClsmOiAXxRhKB kOQXlXG960YHqjbhbaWVz63AZ9WB/mm72rYA0u4rAYKlNL9TcyUX5GR3clWGJCZzr/YX B69gxkK7K7KD7ACWbEVI+aNPpYwGZM39NkEDi8Og7mWjfQDo5zSiRJQ5Q4qqLRDVDWZv Q3LcbCFEUopayNbENMtnJeCVO3uIevu+oUeP/UiKzj/MUf2D/Jwyaj6RhxfPuUch0oMW j3N3LeZF3nmBf0LqAHmtAMBQa2xvIP1jRMgbKJ9ye0wei4bGkvk/c0vQbIwFe9AsIXzp jLXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mJsV1EjC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id aq7si3235660ejc.589.2021.08.17.10.06.51; Tue, 17 Aug 2021 10:07:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mJsV1EjC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231500AbhHQREx (ORCPT + 99 others); Tue, 17 Aug 2021 13:04:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229723AbhHQREx (ORCPT ); Tue, 17 Aug 2021 13:04:53 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2D42C061764; Tue, 17 Aug 2021 10:04:19 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id n13-20020a17090a4e0d00b0017946980d8dso6279037pjh.5; Tue, 17 Aug 2021 10:04:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=74Z3GwaGrI/6L9131Hr1UbUOb6HfxaEgTCmH3K6poSk=; b=mJsV1EjCjypQ/+hVsiuaTX4jdTaHW0J2geVgrgdXMLGaI4kkfM69xiSPEkYG+0XppQ sTHJ+RmAbjFR9HSCTzsNB6avSLRCnQbWKv/V5iuzsqibAv8iKmZcrFTbinA6u9n+eKJ+ hqbLRHC1YJbvo9nQEp0Dzszz2igME0vh5S6ZmXTAGNvUEDsxpG4g18xIzViIDXkc3joM QuUXeK0wLUbII158wLtnW4aF0imAXBPYOGA6hGSwMq6D5lTnsBbBG3vaylwWzZ6EFwFt dg4xR5b/CeLhhdlYpNcmdb8Pwyt0qmQyFF4yq4lhefjrNj4g4W6w25o/uGYZ5AXBI0c9 X38A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=74Z3GwaGrI/6L9131Hr1UbUOb6HfxaEgTCmH3K6poSk=; b=q3VvQw48CDUYLdLgdrvb9T2efFO24Qt8viybzSJ19/No8ai5d3dfiygeNPXSYPQg8m zIv870QD5M+zxb8Y42Dtky6BHmWi6htQG8fmDwUVHPSuWe/9JfHacxC2bORBnTg96Fk7 2t6N/+8JxjSKVW3YedquKn87nFGnhKmIC+Dkp+degYBFoO00L3yN3yKrMlwjj3T7CKo3 dWz9Gu7yRG8DJIFDYGMRW/c0qHiPpBhrfMh5FDtHFMJUZ66oVhjB9raRBB5KLe/MIjhe 6tvMV60A5t/lTe85eU6uD4f3Gr91Zo6sI2pwsVigkmEcRRUPUmL15c1eZTWefUcM1Dj6 Ja7w== X-Gm-Message-State: AOAM533uTEhHyYI/D8bvLlMPu9E8NtYKz5xcgsO1O4FOMOG6KB+7Iz29 28t4/JOqWH27lwY2XL62geE= X-Received: by 2002:a17:90a:aa8f:: with SMTP id l15mr4570586pjq.183.1629219858940; Tue, 17 Aug 2021 10:04:18 -0700 (PDT) Received: from localhost.localdomain ([49.36.211.221]) by smtp.googlemail.com with ESMTPSA id 65sm3958402pgi.12.2021.08.17.10.04.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Aug 2021 10:04:18 -0700 (PDT) From: Utkarsh Verma To: Greg Kroah-Hartman Cc: Jiri Slaby , Andy Shevchenko , Heikki Krogerus , Valmer Huhn , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, Utkarsh Verma Subject: [PATCH] serial: 8250_exar: Add missing call to pci_free_irq_vectors() Date: Tue, 17 Aug 2021 22:30:57 +0530 Message-Id: <20210817170057.16783-1-utkarshverma294@gmail.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Free the pci irq vectors if the call to pci_alloc_irq_vectors() fails or if the device is removed. Signed-off-by: Utkarsh Verma --- drivers/tty/serial/8250/8250_exar.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index 3ffeedc29c83..38b65d6980f5 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -627,8 +627,10 @@ exar_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) pci_set_master(pcidev); rc = pci_alloc_irq_vectors(pcidev, 1, 1, PCI_IRQ_ALL_TYPES); - if (rc < 0) + if (rc < 0) { + pci_free_irq_vectors(pcidev); return rc; + } memset(&uart, 0, sizeof(uart)); uart.port.flags = UPF_SHARE_IRQ | UPF_EXAR_EFR | UPF_FIXED_TYPE | UPF_FIXED_PORT; @@ -677,6 +679,7 @@ static void exar_pci_remove(struct pci_dev *pcidev) if (priv->board->exit) priv->board->exit(pcidev); + pci_free_irq_vectors(pcidev); } static int __maybe_unused exar_suspend(struct device *dev) -- 2.17.1