Skip to content

Commit

Permalink
Merge pull request coolstar#5 from ben9923/fix-analysis
Browse files Browse the repository at this point in the history
Fix NULL Dereference & Update Project Settings
  • Loading branch information
kprinssu authored Apr 24, 2020
2 parents 717565f + 7657eeb commit 0876bed
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
4 changes: 3 additions & 1 deletion VoodooGPIO.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
F1F172BC1F42263A00AD98FA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1140;
ORGANIZATIONNAME = CoolStar;
TargetAttributes = {
F1F172C41F42263A00AD98FA = {
Expand Down Expand Up @@ -316,6 +316,7 @@
F1F172D01F42263A00AD98FA /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1.0.0d1;
INFOPLIST_FILE = VoodooGPIO/Info.plist;
Expand All @@ -330,6 +331,7 @@
F1F172D11F42263A00AD98FA /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1.0.0d1;
INFOPLIST_FILE = VoodooGPIO/Info.plist;
Expand Down
26 changes: 20 additions & 6 deletions VoodooGPIO/VoodooGPIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,10 +474,19 @@ void VoodooGPIO::intel_pinctrl_suspend() {

if (!intel_pinctrl_should_save(desc->number))
continue;

val = readl(intel_get_padcfg(desc->number, PADCFG0));

padcfg = intel_get_padcfg(desc->number, PADCFG0);
if (!padcfg)
continue;

val = readl(padcfg);
pads[i].padcfg0 = val & ~PADCFG0_GPIORXSTATE;
val = readl(intel_get_padcfg(desc->number, PADCFG1));

padcfg = intel_get_padcfg(desc->number, PADCFG1);
if (!padcfg)
continue;

val = readl(padcfg);
pads[i].padcfg1 = val;

padcfg = intel_get_padcfg(desc->number, PADCFG2);
Expand Down Expand Up @@ -523,12 +532,17 @@ void VoodooGPIO::intel_pinctrl_resume() {
continue;

padcfg = intel_get_padcfg(desc->number, PADCFG0);
if (!padcfg)
continue;

val = readl(padcfg) & ~PADCFG0_GPIORXSTATE;
if (val != pads[i].padcfg0) {
if (val != pads[i].padcfg0)
writel(pads[i].padcfg0, padcfg);
}


padcfg = intel_get_padcfg(desc->number, PADCFG1);
if (!padcfg)
continue;

val = readl(padcfg);
if (val != pads[i].padcfg1) {
writel(pads[i].padcfg1, padcfg);
Expand Down

0 comments on commit 0876bed

Please sign in to comment.