diff options
author | Ian Gudger <igudger@google.com> | 2018-05-08 09:51:07 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-05-08 09:51:56 -0700 |
commit | b4765f782d91443ab0415dc00e727d783632e2ad (patch) | |
tree | 82c2b45b7d9fee5ceaf3792e34c5fdf09c69da43 /pkg/sentry/kernel | |
parent | d0d01a18963ed7cfc29e5b8334e30b1234b6048b (diff) |
Fix warning: redundant if ...; err != nil check, just return error instead.
This warning is produced by golint.
PiperOrigin-RevId: 195833381
Change-Id: Idd6a7e57e3cfdf00819f2374b19fc113585dc1e1
Diffstat (limited to 'pkg/sentry/kernel')
-rw-r--r-- | pkg/sentry/kernel/task_signals.go | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/pkg/sentry/kernel/task_signals.go b/pkg/sentry/kernel/task_signals.go index 2340256b0..e4ef7fd67 100644 --- a/pkg/sentry/kernel/task_signals.go +++ b/pkg/sentry/kernel/task_signals.go @@ -127,10 +127,7 @@ func (t *Task) dequeueSignalLocked() *arch.SignalInfo { if info := t.pendingSignals.dequeue(t.tr.SignalMask); info != nil { return info } - if info := t.tg.pendingSignals.dequeue(t.tr.SignalMask); info != nil { - return info - } - return nil + return t.tg.pendingSignals.dequeue(t.tr.SignalMask) } // TakeSignal returns a pending signal not blocked by mask. Signal handlers are @@ -144,10 +141,7 @@ func (t *Task) TakeSignal(mask linux.SignalSet) *arch.SignalInfo { if info := t.pendingSignals.dequeue(mask); info != nil { return info } - if info := t.tg.pendingSignals.dequeue(mask); info != nil { - return info - } - return nil + return t.tg.pendingSignals.dequeue(mask) } // discardSpecificLocked removes all instances of the given signal from all |