[PATCH 22/44] kdbus: Cleanup error path in kdbus_staging_new_user()

From: Sergei Zviagintsev
Date: Thu Oct 08 2015 - 07:33:50 EST


Replace duplicated cleanup code with jump to exit point.

Signed-off-by: Sergei Zviagintsev <sergei@xxxxxxxx>
---
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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/