Replace duplicated cleanup code with jump to exit point.

Signed-off-by: Sergei Zviagintsev <[email protected]>
---
 ipc/kdbus/message.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/ipc/kdbus/message.c b/ipc/kdbus/message.c
index c7ef23d40471..e337b1b1024a 100644
--- a/ipc/kdbus/message.c
+++ b/ipc/kdbus/message.c
@@ -800,8 +800,7 @@ struct kdbus_staging *kdbus_staging_new_user(struct 
kdbus_bus *bus,
                if (IS_ERR(staging->gaps)) {
                        ret = PTR_ERR(staging->gaps);
                        staging->gaps = NULL;
-                       kdbus_staging_free(staging);
-                       return ERR_PTR(ret);
+                       goto error;
                }
        }
 
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to