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 1dv8IQ-0001xf-8C for barebox@lists.infradead.org; Thu, 21 Sep 2017 20:42:08 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Thu, 21 Sep 2017 22:41:39 +0200 Message-Id: <20170921204139.16052-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] gpiolib: check validity for gpio_info in *_active() To: barebox@lists.infradead.org Z3Bpb19zZXRfYWN0aXZlLCBncGlvX2lzX2FjdGl2ZSBhbmQgZ3Bpb19kaXJlY3Rpb25fYWN0aXZl IGFyZSBwdWJsaWMKZnVuY3Rpb25zLCBhY2NvcmRpbmdseSB0aGVyZSBzaG91bGQgYmUgZXJyb3Ig Y2hlY2tpbmcuCgpJZiBhbiBpbnZhbGlkIGdwaW8gbnVtYmVyIGlzIGdpdmVuIHRvIHRoZXNlIGZ1 bmN0aW9ucyB3aXRob3V0IGNoZWNraW5nCmdwaW9fYWRqdXN0X3ZhbHVlIGlzIGNhbGxlZCB3aXRo IGdpID09IE5VTEwgd2hpY2ggdGhlbiBkZXJlZmVyZW5jZXMgdGhpcwpwb2ludGVyLgoKU2lnbmVk LW9mZi1ieTogVXdlIEtsZWluZS1Lw7ZuaWcgPHUua2xlaW5lLWtvZW5pZ0BwZW5ndXRyb25peC5k ZT4KLS0tCiBkcml2ZXJzL2dwaW8vZ3Bpb2xpYi5jIHwgMTIgKysrKysrKysrKysrCiAxIGZpbGUg Y2hhbmdlZCwgMTIgaW5zZXJ0aW9ucygrKQoKZGlmZiAtLW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