All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] ENOMEM detection fix in 16550A driver
@ 2005-11-25 16:17 Jan Kiszka
  2005-11-25 18:39 ` Philippe Gerum
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2005-11-25 16:17 UTC (permalink / raw)
  To: xenomai-core

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

Hi all,

that's what reusing drivers also gives us: Paolo found a small but ugly
bug in the 16550A driver, see attached fix and Changelog (for both 2.0.x
and 2.1.x).

Jan


[-- Attachment #2: 16550A-ENOMEM.patch-2.0 --]
[-- Type: text/plain, Size: 1389 bytes --]

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 182)
+++ ChangeLog	(working copy)
@@ -1,3 +1,8 @@
+2005-11-25  Jan Kiszka <jan.kiszka@domain.hid>
+
+	* drivers/16550A/16550A.c (RTSER_RTIOC_SET_CONFIG): Fix ENOMEM detection
+        (once again). Found by Paolo Mantegazza through cross-usage.
+
 2005-11-21  Philippe Gerum  <rpm@xenomai.org>
 
 	* skins/native, nucleus/pipe.c: Globally replace ENOSPC by
Index: drivers/16550A/16550A.c
===================================================================
--- drivers/16550A/16550A.c	(revision 182)
+++ drivers/16550A/16550A.c	(working copy)
@@ -587,10 +587,9 @@
                     else
                         hist_buf =
                             rtdm_malloc(IN_BUFFER_SIZE * sizeof(uint64_t));
+                    if (!hist_buf)
+                        return -ENOMEM;
                 }
-
-                if (!hist_buf)
-                    return -ENOMEM;
             }
 
             rt_16550_set_config(ctx, config, &hist_buf);
@@ -1025,7 +1024,7 @@
     device_class:       RTDM_CLASS_SERIAL,
     device_sub_class:   RTDM_SUBCLASS_16550A,
     driver_name:        "rt_16550A",
-    driver_version:     RTDM_DRIVER_VER(1, 2, 0),
+    driver_version:     RTDM_DRIVER_VER(1, 2, 1),
     peripheral_name:    "UART 16550A",
     provider_name:      "Jan Kiszka",
 };

[-- Attachment #3: 16550A-ENOMEM.patch-2.1 --]
[-- Type: text/plain, Size: 938 bytes --]

Index: ksrc/drivers/16550A/16550A.c
===================================================================
--- ksrc/drivers/16550A/16550A.c	(revision 182)
+++ ksrc/drivers/16550A/16550A.c	(working copy)
@@ -589,10 +589,9 @@
                     else
                         hist_buf =
                             rtdm_malloc(IN_BUFFER_SIZE * sizeof(uint64_t));
+                    if (!hist_buf)
+                        return -ENOMEM;
                 }
-
-                if (!hist_buf)
-                    return -ENOMEM;
             }
 
             rt_16550_set_config(ctx, config, &hist_buf);
@@ -1027,7 +1026,7 @@
     device_class:       RTDM_CLASS_SERIAL,
     device_sub_class:   RTDM_SUBCLASS_16550A,
     driver_name:        "rt_16550A",
-    driver_version:     RTDM_DRIVER_VER(1, 2, 0),
+    driver_version:     RTDM_DRIVER_VER(1, 2, 1),
     peripheral_name:    "UART 16550A",
     provider_name:      "Jan Kiszka",
 };

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

* Re: [Xenomai-core] ENOMEM detection fix in 16550A driver
  2005-11-25 16:17 [Xenomai-core] ENOMEM detection fix in 16550A driver Jan Kiszka
@ 2005-11-25 18:39 ` Philippe Gerum
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Gerum @ 2005-11-25 18:39 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai-core

Jan Kiszka wrote:
> Hi all,
> 
> that's what reusing drivers also gives us: Paolo found a small but ugly
> bug in the 16550A driver, see attached fix and Changelog (for both 2.0.x
> and 2.1.x).


Applied, thanks.

> 
> Jan
> 
> 
> 
> ------------------------------------------------------------------------
> 
> Index: ChangeLog
> ===================================================================
> --- ChangeLog	(revision 182)
> +++ ChangeLog	(working copy)
> @@ -1,3 +1,8 @@
> +2005-11-25  Jan Kiszka <jan.kiszka@domain.hid>
> +
> +	* drivers/16550A/16550A.c (RTSER_RTIOC_SET_CONFIG): Fix ENOMEM detection
> +        (once again). Found by Paolo Mantegazza through cross-usage.
> +
>  2005-11-21  Philippe Gerum  <rpm@xenomai.org>
>  
>  	* skins/native, nucleus/pipe.c: Globally replace ENOSPC by
> Index: drivers/16550A/16550A.c
> ===================================================================
> --- drivers/16550A/16550A.c	(revision 182)
> +++ drivers/16550A/16550A.c	(working copy)
> @@ -587,10 +587,9 @@
>                      else
>                          hist_buf =
>                              rtdm_malloc(IN_BUFFER_SIZE * sizeof(uint64_t));
> +                    if (!hist_buf)
> +                        return -ENOMEM;
>                  }
> -
> -                if (!hist_buf)
> -                    return -ENOMEM;
>              }
>  
>              rt_16550_set_config(ctx, config, &hist_buf);
> @@ -1025,7 +1024,7 @@
>      device_class:       RTDM_CLASS_SERIAL,
>      device_sub_class:   RTDM_SUBCLASS_16550A,
>      driver_name:        "rt_16550A",
> -    driver_version:     RTDM_DRIVER_VER(1, 2, 0),
> +    driver_version:     RTDM_DRIVER_VER(1, 2, 1),
>      peripheral_name:    "UART 16550A",
>      provider_name:      "Jan Kiszka",
>  };
> 
> 
> ------------------------------------------------------------------------
> 
> Index: ksrc/drivers/16550A/16550A.c
> ===================================================================
> --- ksrc/drivers/16550A/16550A.c	(revision 182)
> +++ ksrc/drivers/16550A/16550A.c	(working copy)
> @@ -589,10 +589,9 @@
>                      else
>                          hist_buf =
>                              rtdm_malloc(IN_BUFFER_SIZE * sizeof(uint64_t));
> +                    if (!hist_buf)
> +                        return -ENOMEM;
>                  }
> -
> -                if (!hist_buf)
> -                    return -ENOMEM;
>              }
>  
>              rt_16550_set_config(ctx, config, &hist_buf);
> @@ -1027,7 +1026,7 @@
>      device_class:       RTDM_CLASS_SERIAL,
>      device_sub_class:   RTDM_SUBCLASS_16550A,
>      driver_name:        "rt_16550A",
> -    driver_version:     RTDM_DRIVER_VER(1, 2, 0),
> +    driver_version:     RTDM_DRIVER_VER(1, 2, 1),
>      peripheral_name:    "UART 16550A",
>      provider_name:      "Jan Kiszka",
>  };
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Xenomai-core mailing list
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core


-- 

Philippe.


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

end of thread, other threads:[~2005-11-25 18:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-25 16:17 [Xenomai-core] ENOMEM detection fix in 16550A driver Jan Kiszka
2005-11-25 18:39 ` Philippe Gerum

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.