Commit 99d4cf76 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'gpio-fixes-for-v6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio fix from Bartosz Golaszewski:

 - fix an error path after a failed export in sysfs code

* tag 'gpio-fixes-for-v6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
  gpiolib: sysfs: Fix error handling on failed export
parents 21b73ffc 95dd1e34
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -474,13 +474,16 @@ static ssize_t export_store(const struct class *class,
		goto done;

	status = gpiod_set_transitory(desc, false);
	if (!status) {
	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)