Skip to content

Commit

Permalink
Merge pull request #367 from q384566678/device-valide
Browse files Browse the repository at this point in the history
validate: perfect deviceValid
  • Loading branch information
Mrunal Patel authored Apr 18, 2017
2 parents bf28e72 + 1d9db8f commit 8addcc6
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions validate/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -684,13 +684,8 @@ func namespaceValid(ns rspec.LinuxNamespace) bool {

func deviceValid(d rspec.LinuxDevice) bool {
switch d.Type {
case "b":
case "c":
case "u":
if d.Major <= 0 {
return false
}
if d.Minor <= 0 {
case "b", "c", "u":
if d.Major <= 0 || d.Minor <= 0 {
return false
}
case "p":
Expand Down

0 comments on commit 8addcc6

Please sign in to comment.