Skip to content

Commit 1d9db8f

Browse files
author
zhouhao
committed
alidate: deviceValid code optimization
Signed-off-by: zhouhao <[email protected]>
1 parent 72ea6e6 commit 1d9db8f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

validate/validate.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -701,10 +701,7 @@ func namespaceValid(ns rspec.LinuxNamespace) bool {
701701
func deviceValid(d rspec.LinuxDevice) bool {
702702
switch d.Type {
703703
case "b", "c", "u":
704-
if d.Major <= 0 {
705-
return false
706-
}
707-
if d.Minor <= 0 {
704+
if d.Major <= 0 || d.Minor <= 0 {
708705
return false
709706
}
710707
case "p":

0 commit comments

Comments
 (0)