nfsd4: check for negative dentry before use in nfsv4 readdir
[safe/jmp/linux-2.6] / include / sound / core.h
index f67952a..3dea798 100644 (file)
@@ -97,9 +97,9 @@ struct snd_device {
 
 struct snd_monitor_file {
        struct file *file;
-       struct snd_monitor_file *next;
        const struct file_operations *disconnected_f_op;
-       struct list_head shutdown_list;
+       struct list_head shutdown_list; /* still need to shutdown */
+       struct list_head list;  /* link of monitor files */
 };
 
 /* main structure for soundcard */
@@ -134,7 +134,7 @@ struct snd_card {
        struct snd_info_entry *proc_id; /* the card id */
        struct proc_dir_entry *proc_root_link;  /* number link to real id */
 
-       struct snd_monitor_file *files; /* all files associated to this card */
+       struct list_head files_list;    /* all files associated to this card */
        struct snd_shutdown_f_ops *s_f_ops; /* file operations in the shutdown
                                                                state */
        spinlock_t files_lock;          /* lock the files for this card */
@@ -296,8 +296,20 @@ int snd_card_locked(int card);
 extern int (*snd_mixer_oss_notify_callback)(struct snd_card *card, int cmd);
 #endif
 
+int snd_card_create(int idx, const char *id,
+                   struct module *module, int extra_size,
+                   struct snd_card **card_ret);
+
+static inline __deprecated
 struct snd_card *snd_card_new(int idx, const char *id,
-                        struct module *module, int extra_size);
+                             struct module *module, int extra_size)
+{
+       struct snd_card *card;
+       if (snd_card_create(idx, id, module, extra_size, &card) < 0)
+               return NULL;
+       return card;
+}
+
 int snd_card_disconnect(struct snd_card *card);
 int snd_card_free(struct snd_card *card);
 int snd_card_free_when_closed(struct snd_card *card);