pinmap: test mode, add uninitialised protection.
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
committed by
Brendan Le Foll
parent
83a5e6cde8
commit
0986b5aa92
@@ -220,6 +220,11 @@ maa_result_print(maa_result_t result)
|
|||||||
maa_boolean_t
|
maa_boolean_t
|
||||||
maa_pin_mode_test(int pin, maa_pinmodes_t mode)
|
maa_pin_mode_test(int pin, maa_pinmodes_t mode)
|
||||||
{
|
{
|
||||||
|
if (plat == NULL) {
|
||||||
|
maa_init();
|
||||||
|
if (plat == NULL)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (pin > plat->phy_pin_count || pin < 0)
|
if (pin > plat->phy_pin_count || pin < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user