]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/blobdiff - net/can/canethgw.c
Properly dereference files in case of bad socket type
[can-eth-gw-linux.git] / net / can / canethgw.c
index 6bd36e624adcce116bbfebb1abbb661718ba7869..8bed57c9d76aa57754c97b521e07931de2f90704 100644 (file)
@@ -314,6 +314,8 @@ static long cegw_ioctl_start(struct file *file, unsigned long arg)
 
        if (job->can_sock->ops->family != AF_CAN ||
            job->can_sock->type != SOCK_RAW) {
+               fput(job->udp_sock->file);
+               fput(job->can_sock->file);
                kfree(job);
                return -EBADF;
        }
@@ -359,7 +361,7 @@ static struct miscdevice cegw_device = {
 
 static int __init cegw_init(void)
 {
-       printk(KERN_INFO "can: can-eth gateway\n");
+       pr_info("can: can-eth gateway\n");
        return misc_register(&cegw_device);
 }