diff options
Diffstat (limited to 'kdbus-fix-up-documentation-of-ioctl-handlers.patch')
-rw-r--r-- | kdbus-fix-up-documentation-of-ioctl-handlers.patch | 185 |
1 files changed, 185 insertions, 0 deletions
diff --git a/kdbus-fix-up-documentation-of-ioctl-handlers.patch b/kdbus-fix-up-documentation-of-ioctl-handlers.patch new file mode 100644 index 000000000..47dc59224 --- /dev/null +++ b/kdbus-fix-up-documentation-of-ioctl-handlers.patch @@ -0,0 +1,185 @@ +From: David Herrmann <dh.herrmann@gmail.com> +Date: Thu, 23 Apr 2015 10:23:38 +0200 +Subject: [PATCH] kdbus: fix up documentation of ioctl handlers + +We support feature negotiation on ioctls. As this is not necessarily fully +generic, we indicate this by returning >0 from kdbus_args_parse(). +Therefore, all ioctl handlers that forward the return value of +kdbus_args_parse() might also return >0 on negotiation. Which is totally +fine and handled in kdbus_handle_ioctl(). However, the documentation of +the ioctl handlers doesn't reflect that behavior. Fix those up! + +Reported-by: Dan Carpenter <dan.carpenter@oracle.com> +Signed-off-by: David Herrmann <dh.herrmann@gmail.com> +--- + ipc/kdbus/bus.c | 4 ++-- + ipc/kdbus/connection.c | 14 +++++++------- + ipc/kdbus/endpoint.c | 4 ++-- + ipc/kdbus/match.c | 4 ++-- + ipc/kdbus/names.c | 6 +++--- + 5 files changed, 16 insertions(+), 16 deletions(-) + +diff --git a/ipc/kdbus/bus.c b/ipc/kdbus/bus.c +index d5475961b896..bbdf0f2f391e 100644 +--- a/ipc/kdbus/bus.c ++++ b/ipc/kdbus/bus.c +@@ -365,7 +365,7 @@ void kdbus_bus_eavesdrop(struct kdbus_bus *bus, + * @domain: domain to operate on + * @argp: command payload + * +- * Return: Newly created bus on success, ERR_PTR on failure. ++ * Return: NULL or newly created bus on success, ERR_PTR on failure. + */ + struct kdbus_bus *kdbus_cmd_bus_make(struct kdbus_domain *domain, + void __user *argp) +@@ -459,7 +459,7 @@ exit: + * @conn: connection to operate on + * @argp: command payload + * +- * Return: 0 on success, negative error code on failure. ++ * Return: >=0 on success, negative error code on failure. + */ + int kdbus_cmd_bus_creator_info(struct kdbus_conn *conn, void __user *argp) + { +diff --git a/ipc/kdbus/connection.c b/ipc/kdbus/connection.c +index cbfbf3847c24..8ee62fc0bd46 100644 +--- a/ipc/kdbus/connection.c ++++ b/ipc/kdbus/connection.c +@@ -1589,7 +1589,7 @@ bool kdbus_conn_policy_see_notification(struct kdbus_conn *conn, + * @privileged: Whether the caller is privileged + * @argp: Command payload + * +- * Return: Newly created connection on success, ERR_PTR on failure. ++ * Return: NULL or newly created connection on success, ERR_PTR on failure. + */ + struct kdbus_conn *kdbus_cmd_hello(struct kdbus_ep *ep, bool privileged, + void __user *argp) +@@ -1676,7 +1676,7 @@ exit: + * + * The caller must not hold any active reference to @conn or this will deadlock. + * +- * Return: 0 on success, negative error code on failure. ++ * Return: >=0 on success, negative error code on failure. + */ + int kdbus_cmd_byebye_unlocked(struct kdbus_conn *conn, void __user *argp) + { +@@ -1708,7 +1708,7 @@ int kdbus_cmd_byebye_unlocked(struct kdbus_conn *conn, void __user *argp) + * @conn: connection to operate on + * @argp: command payload + * +- * Return: 0 on success, negative error code on failure. ++ * Return: >=0 on success, negative error code on failure. + */ + int kdbus_cmd_conn_info(struct kdbus_conn *conn, void __user *argp) + { +@@ -1838,7 +1838,7 @@ exit: + * @conn: connection to operate on + * @argp: command payload + * +- * Return: 0 on success, negative error code on failure. ++ * Return: >=0 on success, negative error code on failure. + */ + int kdbus_cmd_update(struct kdbus_conn *conn, void __user *argp) + { +@@ -1935,7 +1935,7 @@ exit: + * @f: file this command was called on + * @argp: command payload + * +- * Return: 0 on success, negative error code on failure. ++ * Return: >=0 on success, negative error code on failure. + */ + int kdbus_cmd_send(struct kdbus_conn *conn, struct file *f, void __user *argp) + { +@@ -2031,7 +2031,7 @@ exit: + * @conn: connection to operate on + * @argp: command payload + * +- * Return: 0 on success, negative error code on failure. ++ * Return: >=0 on success, negative error code on failure. + */ + int kdbus_cmd_recv(struct kdbus_conn *conn, void __user *argp) + { +@@ -2154,7 +2154,7 @@ exit: + * @conn: connection to operate on + * @argp: command payload + * +- * Return: 0 on success, negative error code on failure. ++ * Return: >=0 on success, negative error code on failure. + */ + int kdbus_cmd_free(struct kdbus_conn *conn, void __user *argp) + { +diff --git a/ipc/kdbus/endpoint.c b/ipc/kdbus/endpoint.c +index 174d274b113e..9a95a5ea84d7 100644 +--- a/ipc/kdbus/endpoint.c ++++ b/ipc/kdbus/endpoint.c +@@ -188,7 +188,7 @@ struct kdbus_ep *kdbus_ep_unref(struct kdbus_ep *ep) + * @bus: bus to operate on + * @argp: command payload + * +- * Return: Newly created endpoint on success, ERR_PTR on failure. ++ * Return: NULL or newly created endpoint on success, ERR_PTR on failure. + */ + struct kdbus_ep *kdbus_cmd_ep_make(struct kdbus_bus *bus, void __user *argp) + { +@@ -247,7 +247,7 @@ exit: + * @ep: endpoint to operate on + * @argp: command payload + * +- * Return: Newly created endpoint on success, ERR_PTR on failure. ++ * Return: >=0 on success, negative error code on failure. + */ + int kdbus_cmd_ep_update(struct kdbus_ep *ep, void __user *argp) + { +diff --git a/ipc/kdbus/match.c b/ipc/kdbus/match.c +index 30cec1ca819f..cc083b4211de 100644 +--- a/ipc/kdbus/match.c ++++ b/ipc/kdbus/match.c +@@ -368,7 +368,7 @@ static int kdbus_match_db_remove_unlocked(struct kdbus_match_db *mdb, + * are used to match messages from userspace, while the others apply to + * kernel-generated notifications. + * +- * Return: 0 on success, negative error code on failure. ++ * Return: >=0 on success, negative error code on failure. + */ + int kdbus_cmd_match_add(struct kdbus_conn *conn, void __user *argp) + { +@@ -528,7 +528,7 @@ exit: + * @conn: connection to operate on + * @argp: command payload + * +- * Return: 0 on success, negative error code on failure. ++ * Return: >=0 on success, negative error code on failure. + */ + int kdbus_cmd_match_remove(struct kdbus_conn *conn, void __user *argp) + { +diff --git a/ipc/kdbus/names.c b/ipc/kdbus/names.c +index 657008e1bb37..5f5d84ea0e8e 100644 +--- a/ipc/kdbus/names.c ++++ b/ipc/kdbus/names.c +@@ -469,7 +469,7 @@ void kdbus_name_release_all(struct kdbus_name_registry *reg, + * @conn: connection to operate on + * @argp: command payload + * +- * Return: 0 on success, negative error code on failure. ++ * Return: >=0 on success, negative error code on failure. + */ + int kdbus_cmd_name_acquire(struct kdbus_conn *conn, void __user *argp) + { +@@ -528,7 +528,7 @@ exit: + * @conn: connection to operate on + * @argp: command payload + * +- * Return: 0 on success, negative error code on failure. ++ * Return: >=0 on success, negative error code on failure. + */ + int kdbus_cmd_name_release(struct kdbus_conn *conn, void __user *argp) + { +@@ -699,7 +699,7 @@ static int kdbus_list_all(struct kdbus_conn *conn, u64 flags, + * @conn: connection to operate on + * @argp: command payload + * +- * Return: 0 on success, negative error code on failure. ++ * Return: >=0 on success, negative error code on failure. + */ + int kdbus_cmd_list(struct kdbus_conn *conn, void __user *argp) + { |