mailbox: return error in mbox_request_channel_byname
PATCH 1/1 mailbox: return error in mbox_request_channel_byname
If 'name' is not found in the "mbox-names" list, return an error
Signed-off-by Fabien Dessenne <[email protected]>
--- drivers/mailbox/mailbox.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/mailbox/mailbox.c +3 -2
@@ -391,11 +391,12 @@ struct mbox_chan *mbox_request_channel_byname(struct mbox_client *cl,of_property_for_each_string (np,"mbox-names" , prop, mbox_name) {if (!strncmp (name, mbox_name,strlen (name))) -break ; +return mbox_request_channel (cl, index); index++; } -return mbox_request_channel (cl, index); +dev_err (cl->dev,"%s() mbox %s not found\n" , __func__, name); +return ERR_PTR (-EINVAL ); }EXPORT_SYMBOL_GPL (mbox_request_channel_byname);
Signature · 1 line
2.7.4
oops! you can forget this patch, the original implementation is correct
BR
Fabien
Quoted 26 lines · Fabien DESSENNE
If 'name' is not found in the "mbox-names" list, return an error
Signed-off-by Fabien Dessenne <[email protected]>--- drivers/mailbox/mailbox.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/mailbox/mailbox.c +3
-2@@ -391,11 +391,12 @@ struct mbox_chan *mbox_request_channel_byname(struct mbox_client *cl,of_property_for_each_string (np,"mbox-names" , prop, mbox_name) {if (!strncmp (name, mbox_name,strlen (name))) -break ; +return mbox_request_channel (cl, index); index++; } -return mbox_request_channel (cl, index); +dev_err (cl->dev,"%s() mbox %s not found\n" , __func__, name); +return ERR_PTR (-EINVAL ); }EXPORT_SYMBOL_GPL (mbox_request_channel_byname);