From: Wolfram Sang <wsa@kernel.org>
To: Yuan Can <yuancan@huawei.com>
Cc: avifishman70@gmail.com, tmaimon77@gmail.com,
tali.perry1@gmail.com, venture@google.com, yuenn@google.com,
benjaminfair@google.com, andriy.shevchenko@linux.intel.com,
openbmc@lists.ozlabs.org, linux-i2c@vger.kernel.org
Subject: Re: [PATCH] i2c: npcm7xx: Fix error handling in npcm_i2c_init()
Date: Sat, 12 Nov 2022 21:27:42 +0100 [thread overview]
Message-ID: <Y3ABviGqOD52gEAC@shikoro> (raw)
In-Reply-To: <20221109112250.124829-1-yuancan@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 1035 bytes --]
On Wed, Nov 09, 2022 at 11:22:50AM +0000, Yuan Can wrote:
> A problem about i2c-npcm7xx create debugfs failed is triggered with the
> following log given:
>
> [ 173.827310] debugfs: Directory 'npcm_i2c' with parent '/' already present!
>
> The reason is that npcm_i2c_init() returns platform_driver_register()
> directly without checking its return value, if platform_driver_register()
> failed, it returns without destroy the newly created debugfs, resulting
> the debugfs of npcm_i2c can never be created later.
>
> npcm_i2c_init()
> debugfs_create_dir() # create debugfs directory
> platform_driver_register()
> driver_register()
> bus_add_driver()
> priv = kzalloc(...) # OOM happened
> # return without destroy debugfs directory
>
> Fix by removing debugfs when platform_driver_register() returns error.
>
> Fixes: 56a1485b102e ("i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver")
> Signed-off-by: Yuan Can <yuancan@huawei.com>
Applied to for-current, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2022-11-12 20:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-09 11:22 [PATCH] i2c: npcm7xx: Fix error handling in npcm_i2c_init() Yuan Can
2022-11-09 13:34 ` Tali Perry
2022-11-12 20:27 ` Wolfram Sang [this message]
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=Y3ABviGqOD52gEAC@shikoro \
--to=wsa@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=avifishman70@gmail.com \
--cc=benjaminfair@google.com \
--cc=linux-i2c@vger.kernel.org \
--cc=openbmc@lists.ozlabs.org \
--cc=tali.perry1@gmail.com \
--cc=tmaimon77@gmail.com \
--cc=venture@google.com \
--cc=yuancan@huawei.com \
--cc=yuenn@google.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