Revert "kref: double kref_put() in my_data_handler()"
authorThomas Hellstrom <thellstrom@vmware.com>
Mon, 6 Mar 2017 07:19:27 +0000 (08:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Apr 2017 16:38:10 +0000 (18:38 +0200)
This reverts commit 8f1ecc9fbc5b223e4f5d5bb8bcd6f5672c4bc4b6.

The correction is incorrect, see discussion at

http://stackoverflow.com/questions/20093127/why-kref-doc-of-linux-kernel-omits-kref-put-when-kthread-run-fail

Reported-by: KrishnamRaju raju <ekraju@gmail.com>
Cc: Roel Kluin <roel.kluin@gmail.com>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: KrishnamRaju raju <ekraju@gmail.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/kref.txt

index ddf85a5dde0c12a435b9cbcc30f44159de5acc0b..d26a27ca964d4906e2955778393f99fa25d52153 100644 (file)
@@ -84,6 +84,7 @@ int my_data_handler(void)
        task = kthread_run(more_data_handling, data, "more_data_handling");
        if (task == ERR_PTR(-ENOMEM)) {
                rv = -ENOMEM;
+               kref_put(&data->refcount, data_release);
                goto out;
        }