All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] [PATCH] RTCAN bug fix
@ 2006-09-03 12:48 Wolfgang Grandegger
  2006-09-03 21:18 ` Jan Kiszka
  0 siblings, 1 reply; 2+ messages in thread
From: Wolfgang Grandegger @ 2006-09-03 12:48 UTC (permalink / raw)
  To: xenomai-core

[-- Attachment #1: Type: text/plain, Size: 213 bytes --]

Hello,

attached is a patch changing:

    * ksrc/drivers/can/rtcan_dev.c (rtcan_dev_register): Bug fixed
    when maximum number of devices is exeeded.

BTW, a similar bug is present in RTnet as well.

Wolfgang.

[-- Attachment #2: xenomai-rtcan-dev-enomem.patch --]
[-- Type: text/x-patch, Size: 1209 bytes --]

+ diff -u xenomai/ChangeLog-ENOMEM xenomai/ChangeLog
--- xenomai/ChangeLog-ENOMEM	2006-09-03 10:14:22.000000000 +0200
+++ xenomai/ChangeLog	2006-09-03 14:43:39.000000000 +0200
@@ -1,3 +1,8 @@
+2006-09-03  Wolfgang Grandegger <wg@domain.hid>
+
+	* ksrc/drivers/can/rtcan_dev.c (rtcan_dev_register): Bug fixed
+	when maximum number of devices is exeeded.
+
 2006-08-31  Gilles Chanteperdrix  <gilles.chanteperdrix@xenomai.org>
 
 	* include/asm-generic/system.h (__xnlock_get): Simplify spinlocks
+ diff -u xenomai/ksrc/drivers/can/rtcan_dev.c-ENOMEM xenomai/ksrc/drivers/can/rtcan_dev.c
--- xenomai/ksrc/drivers/can/rtcan_dev.c-ENOMEM	2006-08-23 22:12:20.000000000 +0200
+++ xenomai/ksrc/drivers/can/rtcan_dev.c	2006-09-03 12:05:23.000000000 +0200
@@ -223,13 +223,17 @@
 int rtcan_dev_register(struct rtcan_device *dev)
 {
     rtdm_lockctx_t context;
-
+    int ret;
 
     down(&rtcan_devices_nrt_lock);
 
     rtcan_global_init();
 
-    dev->ifindex = __rtcan_dev_new_index();
+    if ((ret = __rtcan_dev_new_index()) < 0) {
+        up(&rtcan_devices_nrt_lock);
+        return ret;	
+    }
+    dev->ifindex = ret;
 
     if (strchr(dev->name,'%') != NULL)
         rtcan_dev_alloc_name(dev, dev->name);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Xenomai-core] [PATCH] RTCAN bug fix
  2006-09-03 12:48 [Xenomai-core] [PATCH] RTCAN bug fix Wolfgang Grandegger
@ 2006-09-03 21:18 ` Jan Kiszka
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2006-09-03 21:18 UTC (permalink / raw)
  To: Wolfgang Grandegger; +Cc: xenomai-core

[-- Attachment #1: Type: text/plain, Size: 355 bytes --]

Wolfgang Grandegger wrote:
> Hello,
> 
> attached is a patch changing:
> 
>    * ksrc/drivers/can/rtcan_dev.c (rtcan_dev_register): Bug fixed
>    when maximum number of devices is exeeded.

Applied.

> 
> BTW, a similar bug is present in RTnet as well.

Yep, fixed there as well. Thanks.

All pending CAN patches are now in SVN.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-09-03 21:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-03 12:48 [Xenomai-core] [PATCH] RTCAN bug fix Wolfgang Grandegger
2006-09-03 21:18 ` Jan Kiszka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.