From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dv8Lc-0002R4-0H for barebox@lists.infradead.org; Thu, 21 Sep 2017 20:45:25 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Thu, 21 Sep 2017 22:44:55 +0200 Message-Id: <20170921204455.21403-1-u.kleine-koenig@pengutronix.de> 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 v2] gpiolib: check validity for gpio_info in *_active() To: barebox@lists.infradead.org Z3Bpb19zZXRfYWN0aXZlLCBncGlvX2lzX2FjdGl2ZSBhbmQgZ3Bpb19kaXJlY3Rpb25fYWN0aXZl IGFyZSBwdWJsaWMKZnVuY3Rpb25zLCBhY2NvcmRpbmdseSB0aGVyZSBzaG91bGQgYmUgZXJyb3Ig Y2hlY2tpbmcuCgpJZiBhbiBpbnZhbGlkIGdwaW8gbnVtYmVyIGlzIGdpdmVuIHRvIHRoZXNlIGZ1 bmN0aW9ucyB3aXRob3V0IGNoZWNraW5nCmdwaW9fYWRqdXN0X3ZhbHVlIGlzIGNhbGxlZCB3aXRo IGdpID09IE5VTEwgd2hpY2ggdGhlbiBkZXJlZmVyZW5jZXMgdGhpcwpwb2ludGVyLgoKU2lnbmVk LW9mZi1ieTogVXdlIEtsZWluZS1Lw7ZuaWcgPHUua2xlaW5lLWtvZW5pZ0BwZW5ndXRyb25peC5k ZT4KLS0tCkNoYW5nZXMgc2luY2UgKGltcGxpY2l0KSB2MToKCiAtIG1ha2UgaXQgY29tcGlsZSAo c2lnaCkKCiBkcml2ZXJzL2dwaW8vZ3Bpb2xpYi5jIHwgM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