File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -109,16 +109,13 @@ struct pps_device *pps_register_source(struct pps_source_info *info,
109109 if (err < 0 ) {
110110 pr_err ("%s: unable to create char device\n" ,
111111 info -> name );
112- goto kfree_pps ;
112+ goto pps_register_source_exit ;
113113 }
114114
115115 dev_dbg (& pps -> dev , "new PPS source %s\n" , info -> name );
116116
117117 return pps ;
118118
119- kfree_pps :
120- kfree (pps );
121-
122119pps_register_source_exit :
123120 pr_err ("%s: unable to register source\n" , info -> name );
124121
Original file line number Diff line number Diff line change @@ -374,6 +374,7 @@ int pps_register_cdev(struct pps_device *pps)
374374 pps -> info .name );
375375 err = - EBUSY ;
376376 }
377+ kfree (pps );
377378 goto out_unlock ;
378379 }
379380 pps -> id = err ;
@@ -383,13 +384,11 @@ int pps_register_cdev(struct pps_device *pps)
383384 pps -> dev .devt = MKDEV (pps_major , pps -> id );
384385 dev_set_drvdata (& pps -> dev , pps );
385386 dev_set_name (& pps -> dev , "pps%d" , pps -> id );
387+ pps -> dev .release = pps_device_destruct ;
386388 err = device_register (& pps -> dev );
387389 if (err )
388390 goto free_idr ;
389391
390- /* Override the release function with our own */
391- pps -> dev .release = pps_device_destruct ;
392-
393392 pr_debug ("source %s got cdev (%d:%d)\n" , pps -> info .name , pps_major ,
394393 pps -> id );
395394
You can’t perform that action at this time.
0 commit comments