From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.savoirfairelinux.com ([208.88.110.44]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1exgi0-00071l-50 for barebox@lists.infradead.org; Sun, 18 Mar 2018 22:23:21 +0000 From: =?UTF-8?q?Ga=C3=ABl=20PORTAY?= Date: Sun, 18 Mar 2018 18:22:36 -0400 Message-Id: <20180318222236.28296-1-gael.portay@savoirfairelinux.com> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH] fs: check pointer returned by get_fsdevice_by_path before dereferencing To: barebox@lists.infradead.org Cc: =?utf-8?q?Ga=C3=ABl=20PORTAY?= SW4gX19jYW5vbmljYWxpemVfcGF0aCgpIHdlIGRlcmVmZXJlbmNlIHRoZSBwb2ludGVyIHJldHVy bmVkIGJ5CmdldF9mc2RldmljZV9ieV9wYXRoKCkgd2l0aG91dCBjaGVja2luZyBpZiB0aGUgcG9p bnRlciBpcyBOVUxMIG9yIG5vdC4KV2hlbiB0aGUgcG9pbnRlciBpcyBOVUxMIGl0IGxlYWRzIHRv IGFuIE9vb3BzLgoKCU9vb3BzLCBhZGRyZXNzIGVycm9yIG9uIGxvYWQgb3IgaWZldGNoIQoKCSQg MCAgIDogMDAwMDAwMDAgMDAwMDAwMDEgYTAwMDAwMjYgYTA4MTFjMTAKCSQgNCAgIDogYTA0MDJl NjAgYTA0MDJlNDggYTA4MTFjMDAgYTA0MDJlNTgKCSQgOCAgIDogMDAwMDAwMDEgMDAwMDAwMDAg MDAwMDAwNWEgMDAwMDAwMjMKCSQxMiAgIDogMDAwMDAwMDAgMDAwMDAwMDIgMDA2MDEwMjEgMDAw MDAwMDAKCSQxNiAgIDogYTA0MDJlNjAgYTA0MDJlNTAgYTA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