repo.or.cz
/
smatch.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
extra: tweak hard max in conditions and macros
[smatch.git]
/
validation
/
sm_dev_hold.c
blob
f69f70f3858fa18187f38d5d90494b40e8056186
1
void
dev_hold
(
int
*
x
);
2
3
void
dev_put
(
int
*
x
){}
4
5
extern
int
y
,
z
;
6
int
*
x
;
7
8
int
func
(
void
)
9
{
10
dev_hold
(
x
);
11
if
(
y
) {
12
dev_put
(
x
);
13
return
-
1
;
14
}
15
if
(
z
) {
16
return
-
1
;
17
}
18
return
0
;
19
}
20
/*
21
* check-name: dev_hold() check
22
* check-command: smatch --project=kernel sm_dev_hold.c
23
*
24
* check-output-start
25
sm_dev_hold.c:16 func() warn: 'x' held on error path.
26
* check-output-end
27
*/