Showing error 883

User: Jiri Slaby
Error type: Resource Leak
Error type description: The code omits to put the resource to the system for reuse
File location: drivers/usb/serial/mct_u232.c
Line in file: 573
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2011-11-07 22:41:42 UTC


Source:

543        switch (status) {
544        case 0:
545                /* success */
546                break;
547        case -ECONNRESET:
548        case -ENOENT:
549        case -ESHUTDOWN:
550                /* this urb is terminated, clean up */
551                dbg("%s - urb shutting down with status: %d",
552                    __func__, status);
553                return;
554        default:
555                dbg("%s - nonzero urb status received: %d",
556                    __func__, status);
557                goto exit;
558        }
559
560        if (!serial) {
561                dbg("%s - bad serial pointer, exiting", __func__);
562                return;
563        }
564
565        dbg("%s - port %d", __func__, port->number);
566        usb_serial_debug_data(debug, &port->dev, __func__,
567                                        urb->actual_length, data);
568
569        /*
570         * Work-a-round: handle the 'usual' bulk-in pipe here
571         */
572        if (urb->transfer_buffer_length > 2) {
573                tty = tty_port_tty_get(&port->port);
574                if (urb->actual_length) {
575                        tty_insert_flip_string(tty, data, urb->actual_length);
576                        tty_flip_buffer_push(tty);
577                        tty_kref_put(tty);
578                }
579                goto exit;
580        }
581
582        /*
583         * The interrupt-in pipe signals exceptional conditions (modem line
Show full sources