]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/commitdiff
Properly dereference files in case of bad socket type
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 20 Dec 2012 17:00:31 +0000 (18:00 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 20 Dec 2012 17:00:31 +0000 (18:00 +0100)
net/can/canethgw.c

index 43dbbf630219ec40d2a7c118ac75e330a41f6981..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;
        }