From: Wolfgang Grandegger <wg@domain.hid>
To: xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] [PATCH] RTCAN bug fix
Date: Sun, 03 Sep 2006 14:48:23 +0200 [thread overview]
Message-ID: <44FACF17.2020806@domain.hid> (raw)
[-- 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);
next reply other threads:[~2006-09-03 12:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-03 12:48 Wolfgang Grandegger [this message]
2006-09-03 21:18 ` [Xenomai-core] [PATCH] RTCAN bug fix Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44FACF17.2020806@domain.hid \
--to=wg@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.