summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-05-27 16:30:38 -0400
committerGitHub <noreply@github.com>2020-05-27 16:30:38 -0400
commitadca437d03bc74edcf3ef9b60ea55360157f893c (patch)
treecb682a75cd256a6276a8d08744c6d12483d713c6 /pkg
parentc64abd0b037e5918d6d24e326005ae65131dd738 (diff)
parent339ffd8ade8098a7f872fce9e10ca91f1802677d (diff)
downloadpodman-adca437d03bc74edcf3ef9b60ea55360157f893c.tar.gz
podman-adca437d03bc74edcf3ef9b60ea55360157f893c.tar.bz2
podman-adca437d03bc74edcf3ef9b60ea55360157f893c.zip
Merge pull request #6410 from haircommander/fix-segfault
specgen: fix segfault
Diffstat (limited to 'pkg')
-rw-r--r--pkg/specgen/generate/config_linux.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/pkg/specgen/generate/config_linux.go b/pkg/specgen/generate/config_linux.go
index 1b2a2ac32..f4cf0c704 100644
--- a/pkg/specgen/generate/config_linux.go
+++ b/pkg/specgen/generate/config_linux.go
@@ -72,13 +72,17 @@ func addPrivilegedDevices(g *generate.Generator) error {
newMounts = append(newMounts, devMnt)
}
g.Config.Mounts = append(newMounts, g.Config.Mounts...)
- g.Config.Linux.Resources.Devices = nil
+ if g.Config.Linux.Resources != nil {
+ g.Config.Linux.Resources.Devices = nil
+ }
} else {
for _, d := range hostDevices {
g.AddDevice(Device(d))
}
// Add resources device - need to clear the existing one first.
- g.Config.Linux.Resources.Devices = nil
+ if g.Config.Linux.Resources != nil {
+ g.Config.Linux.Resources.Devices = nil
+ }
g.AddLinuxResourcesDevice(true, "", nil, nil, "rwm")
}