OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] Fix OOPS in show_uevent()
Re: [PATCH] Fix OOPS in show_uevent() [message #15744 is a reply to message #15739] Fri, 10 August 2007 13:37 Go to previous messageGo to previous message
Cornelia Huck is currently offline  Cornelia Huck
Messages: 16
Registered: August 2007
Junior Member
On Fri, 10 Aug 2007 17:21:51 +0400,
Pavel Emelyanov <xemul@openvz.org> wrote:

> Cornelia Huck wrote:
> > On Fri, 10 Aug 2007 14:23:56 +0200,
> > "Kay Sievers" <kay.sievers@vrfy.org> wrote:
> > 
> >> But we still don't update the remaining buffer size and the remaining
> >> array fields which are left after the call. Shouldn't we instead just
> >> change the:
> >>    int (*dev_uevent)(struct device *dev,
> >>                                 char **envp, int num_envp,
> >>                                 char *buffer, int buffer_size);
> >> to:
> >>   int (*dev_uevent)(struct device *dev,
> >>                                char **envp, int num_envp, int *cur_index,
> >>                                char *buffer, int buffer_size, int *cur_len);
> >>
> >> like we do for:
> >>   int add_uevent_var(char **envp, int num_envp, int *cur_index,
> >>                                   char *buffer, int buffer_size, int *cur_len,
> >>                                   const char *format, ...)
> >>
> >> and along with the change of the callers, we would update the values
> >> properly, so the next call has the correct numbers? There are 6
> >> classes and something like 12 buses using this method, so it shouldn't
> >> be too much trouble.
> 
> isn't it better to change
>     int (*dev_uevent)(struct device *dev,
>                                  char **envp, int num_envp,
>                                  char *buffer, int buffer_size);
> to
>     int (*dev_uevent)(struct device *dev,
>                                  char **envp, int num_envp,
>                                  char **buffer);
> and alter the buffer pointer inside?

But the function wants to know the buffer_size, doesn't it?
(And the caller can make the adjustments easily; it saves duplicated
code.)
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [PATCH 20/20] Remove the struct pid unneeded fields
Next Topic: [PATCH 3/20] Introduce MS_KERNMOUNT flag
Goto Forum:
  


Current Time: Sun Oct 19 11:38:29 GMT 2025

Total time taken to generate the page: 0.59063 seconds