diff options
| author | Greg Kroah-Hartman <[email protected]> | 2023-12-11 08:39:35 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2023-12-11 08:39:35 +0100 |
| commit | 0e42b5fee8a8c5bc173f702b0745da6d9329c714 (patch) | |
| tree | a71b0daded5764fcc33b88f9344872c13f4b488e /drivers/gpio/gpiolib-sysfs.c | |
| parent | 386a766c4169006d0e9df44823849930b8995e32 (diff) | |
| parent | a39b6ac3781d46ba18193c9dbb2110f31e9bffe9 (diff) | |
Merge 6.7-rc5 into char-misc-next
We need the char/misc fixes in here as well for testing and to build off
of.
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/gpio/gpiolib-sysfs.c')
| -rw-r--r-- | drivers/gpio/gpiolib-sysfs.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c index 6f309a3b2d9a..12d853845bb8 100644 --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c @@ -474,14 +474,17 @@ static ssize_t export_store(const struct class *class, goto done; status = gpiod_set_transitory(desc, false); - if (!status) { - status = gpiod_export(desc, true); - if (status < 0) - gpiod_free(desc); - else - set_bit(FLAG_SYSFS, &desc->flags); + if (status) { + gpiod_free(desc); + goto done; } + status = gpiod_export(desc, true); + if (status < 0) + gpiod_free(desc); + else + set_bit(FLAG_SYSFS, &desc->flags); + done: if (status) pr_debug("%s: status %d\n", __func__, status); |