lkml.org 
[lkml]   [2005]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC][PATCH 1/6] RTC subsystem, class
Date
Hi,

On Tuesday 20 December 2005 15:45, Alessandro Zummo wrote:
> +int rtc_read_time(struct class_device *class_dev, struct rtc_time *tm)
> +{
> +       int err = -EINVAL;
> +       struct rtc_class_ops *ops = class_get_devdata(class_dev);
> +
> +       if (ops->read_time) {
> +               memset(tm, 0, sizeof(struct rtc_time));
>

What guarantees that ops is not NULL here? Userspace can keep the
attribute (file) open and issue read after class_device was unregistered
and devdata set to NULL.

--
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-12-21 03:04    [W:0.089 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site