Skip to contentSkip to conversation

CONNECTOR: return proper error code in cn_call_callback()

PATCH In review Li Zefan 3 participants 3 messages Jan 4, 2008 – Jan 5, 2008 Network drivers

lore
Share & tools
lore

Li Zefan

author
#0 lore raw

PATCH 5/5 CONNECTOR: return proper error code in cn_call_callback()

Error code should be set to EINVAL instead of ENODEV if !queue_work(). There's another call of queue_work() which may set err to EINVAL.

---
 drivers/connector/connector.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/connector/connector.c +2 -0
index 865303b..37976dc 100644
@@ -146,6 +146,8 @@ static int cn_call_callback(struct cn_msg *msg, void (*destruct_data)(void *), v
 				if (queue_work(dev->cbdev->cn_queue,
 							&__cbq->work))
 					err = 0;
+				else
+					err = -EINVAL;
 			} else {
 				struct cn_callback_data *d;
 				
Signature · 1 line
1.5.3.rc7
maintainer
#1 lore raw

From: Li Zefan <[email protected]>
Date: Fri, 04 Jan 2008 13:53:05 +0800

Quoted 4 lines

Error code should be set to EINVAL instead of ENODEV if !queue_work(). There's another call of queue_work() which may set err to EINVAL.

This one is a bug fix so I'll apply it to net-2.6 and push to Linus.

The rest are cleanups which I'll queue up for 2.6.25

Thanks.

#2 lore raw

Hi.

Sorry for long reply.

Quoted 9 lines · David Miller
Quoted 4 lines

Error code should be set to EINVAL instead of ENODEV if !queue_work(). There's another call of queue_work() which may set err to EINVAL.

This one is a bug fix so I'll apply it to net-2.6 and push to Linus.

The rest are cleanups which I'll queue up for 2.6.25

Although I'm not sure changing error from nodev to inval is a bug fix :), I have no problem with pushing it first.
Loop above will break out after first matched id, so it will never call the path, which can change error, again.

Thanks a lot for patches and quick merge!

Signature · 1 line
	Evgeniy Polyakov