From: Niklas Cassel <cassel@kernel.org>
To: Damien Le Moal <dlemoal@kernel.org>,
Alexander Roman <monderasdor@gmail.com>,
linux-ide@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH V3] ahci: enhance error handling in ahci_init_one
Date: Sun, 25 May 2025 00:10:07 +0200 [thread overview]
Message-ID: <C819CAA3-3F8B-44A3-BD65-82B06378839E@kernel.org> (raw)
In-Reply-To: <7533f274-dcc9-42a5-9e5a-74019255fd3c@kernel.org>
On 24 May 2025 14:36:24 CEST, Damien Le Moal <dlemoal@kernel.org> wrote:
>On 5/22/25 12:26, Alexander Roman wrote:
>> Add comprehensive error handling to ahci_init_one() to:
>> 1. Prevent resource leaks during initialization failures
>> 2. Ensure proper cleanup of allocated resources
>> 3. Provide detailed error reporting for debugging
>> 4. Maintain consistent error handling patterns
>>
>> Key changes:
>> - Initialize all pointers to NULL
>> - Add centralized error handling via goto labels
>> - Improve error messages with specific error codes
>> - Remove duplicate Intel PCS quirk call
>> - Adjust log levels (dev_err for fatal, dev_dbg for quirks)
>>
>> Signed-off-by: Alexander Roman <monderasdor@gmail.com>
>
>I received 2 x v3 patches with different commit messages and titles, but these 2
>patches touch the same code.. Very confusing...
>Which one is the "correct" patch you want us to consider ?
>
>And please send patches to *all* maintainers of the subsystem.
>You can check that with "scripts/get_maintainer.pl driver/ata"
>(you are missing Niklas).
>
>Note: it is too late to apply this patch anyway. If accepted, it will go in
>during 6.16-rc1. So no rush to clean this up. Take your time and make a proper
>patch please.
>
>
>> ---
>> drivers/ata/ahci.c | 98 ++++++++++++++++++++++++++--------------------
>> 1 file changed, 55 insertions(+), 43 deletions(-)
>>
>> diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
>> index abc1234..def5678 100644
>> --- a/drivers/ata/ahci.c
>> +++ b/drivers/ata/ahci.c
>> @@ -1611,7 +1611,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>> struct ahci_host_priv *hpriv = NULL;
>> struct ata_host *host = NULL;
>> void __iomem *mmio = NULL;
>> - int n_ports, i, rc;
>> + int n_ports, i, rc = -ENOMEM;
>> u32 tmp, cap, port_map;
>> u32 saved_cap;
>> struct device *dev = &pdev->dev;
>> @@ -1619,60 +1619,72 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>> VPRINTK("ahci_init_one enter\n");
There is no VPRINTK() here since a long time ago.
So this must be based on some ancient kernel version.
Please base your patches on:
https://git.kernel.org/pub/scm/linux/kernel/git/libata/linux.git/log/?h=for-next
Kind regards,
Niklas
Hello Alexander,
next prev parent reply other threads:[~2025-05-24 22:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-19 22:13 [PATCH V2] ahci: enhance error handling and resource management " Alexander Roman
2025-05-22 5:42 ` Damien Le Moal
2025-05-22 10:00 ` [PATCH V3] " Alexander Roman
2025-05-24 12:37 ` Damien Le Moal
2025-05-22 10:26 ` [PATCH V3] ahci: enhance error handling " Alexander Roman
2025-05-24 12:36 ` Damien Le Moal
2025-05-24 22:10 ` Niklas Cassel [this message]
2025-05-26 8:11 ` Niklas Cassel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=C819CAA3-3F8B-44A3-BD65-82B06378839E@kernel.org \
--to=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=monderasdor@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®