Skip to content

Commit 8addcc6

Browse files
author
Mrunal Patel
authored
Merge pull request #367 from q384566678/device-valide
validate: perfect deviceValid
2 parents bf28e72 + 1d9db8f commit 8addcc6

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

validate/validate.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -684,13 +684,8 @@ func namespaceValid(ns rspec.LinuxNamespace) bool {
684684

685685
func deviceValid(d rspec.LinuxDevice) bool {
686686
switch d.Type {
687-
case "b":
688-
case "c":
689-
case "u":
690-
if d.Major <= 0 {
691-
return false
692-
}
693-
if d.Minor <= 0 {
687+
case "b", "c", "u":
688+
if d.Major <= 0 || d.Minor <= 0 {
694689
return false
695690
}
696691
case "p":

0 commit comments

Comments
 (0)