Commit 6e3c1a68 authored by Li Qiang's avatar Li Qiang Committed by Gerd Hoffmann
Browse files

usb: dev-mtp: close fd in usb_mtp_object_readdir()



Spotted by Coverity: CID 1397070

Signed-off-by: default avatarLi Qiang <liq3ea@163.com>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20190103133113.49599-1-liq3ea@163.com

[ kraxel: dropped chunk which adds close() after successful
          fdopendir() call, that is not needed according to
          POSIX even though Coverity flags it as bug ]

Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent b63e1050
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -666,6 +666,7 @@ static void usb_mtp_object_readdir(MTPState *s, MTPObject *o)
    }
    dir = fdopendir(fd);
    if (!dir) {
        close(fd);
        return;
    }
#ifdef CONFIG_INOTIFY1