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 @@ -375,6 +375,7 @@ int pps_register_cdev(struct pps_device *pps)
375375 pps -> info .name );
376376 err = - EBUSY ;
377377 }
378+ kfree (pps );
378379 goto out_unlock ;
379380 }
380381 pps -> id = err ;
@@ -384,13 +385,11 @@ int pps_register_cdev(struct pps_device *pps)
384385 pps -> dev .devt = MKDEV (pps_major , pps -> id );
385386 dev_set_drvdata (& pps -> dev , pps );
386387 dev_set_name (& pps -> dev , "pps%d" , pps -> id );
388+ pps -> dev .release = pps_device_destruct ;
387389 err = device_register (& pps -> dev );
388390 if (err )
389391 goto free_idr ;
390392
391- /* Override the release function with our own */
392- pps -> dev .release = pps_device_destruct ;
393-
394393 pr_debug ("source %s got cdev (%d:%d)\n" , pps -> info .name , pps_major ,
395394 pps -> id );
396395
You can’t perform that action at this time.
0 commit comments