diff options
| author | Theodore Ts'o <tytso@mit.edu> | 2010-07-27 11:56:04 -0400 |
|---|---|---|
| committer | Theodore Ts'o <tytso@mit.edu> | 2010-07-27 11:56:04 -0400 |
| commit | e5880d76aea443b04e07da19830da0f6f7494eef (patch) | |
| tree | 24ad55c300a63170ffcf5a777dc737c67d80e00c /include/trace | |
| parent | 89eeddf03327e19cfcbb18efa98e5470e2f5c563 (diff) | |
ext4: fix potential NULL dereference while tracing
The allocation_context pointer can be NULL.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'include/trace')
| -rw-r--r-- | include/trace/events/ext4.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index f3865c7b4166..01e9e0076a92 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h | |||
| @@ -395,11 +395,12 @@ DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_group_pa, | |||
| 395 | ); | 395 | ); |
| 396 | 396 | ||
| 397 | TRACE_EVENT(ext4_mb_release_inode_pa, | 397 | TRACE_EVENT(ext4_mb_release_inode_pa, |
| 398 | TP_PROTO(struct ext4_allocation_context *ac, | 398 | TP_PROTO(struct super_block *sb, |
| 399 | struct ext4_allocation_context *ac, | ||
| 399 | struct ext4_prealloc_space *pa, | 400 | struct ext4_prealloc_space *pa, |
| 400 | unsigned long long block, unsigned int count), | 401 | unsigned long long block, unsigned int count), |
| 401 | 402 | ||
| 402 | TP_ARGS(ac, pa, block, count), | 403 | TP_ARGS(sb, ac, pa, block, count), |
| 403 | 404 | ||
| 404 | TP_STRUCT__entry( | 405 | TP_STRUCT__entry( |
| 405 | __field( dev_t, dev ) | 406 | __field( dev_t, dev ) |
| @@ -410,8 +411,9 @@ TRACE_EVENT(ext4_mb_release_inode_pa, | |||
| 410 | ), | 411 | ), |
| 411 | 412 | ||
| 412 | TP_fast_assign( | 413 | TP_fast_assign( |
| 413 | __entry->dev = ac->ac_sb->s_dev; | 414 | __entry->dev = sb->s_dev; |
| 414 | __entry->ino = ac->ac_inode->i_ino; | 415 | __entry->ino = (ac && ac->ac_inode) ? |
| 416 | ac->ac_inode->i_ino : 0; | ||
| 415 | __entry->block = block; | 417 | __entry->block = block; |
| 416 | __entry->count = count; | 418 | __entry->count = count; |
| 417 | ), | 419 | ), |
| @@ -422,10 +424,11 @@ TRACE_EVENT(ext4_mb_release_inode_pa, | |||
| 422 | ); | 424 | ); |
| 423 | 425 | ||
| 424 | TRACE_EVENT(ext4_mb_release_group_pa, | 426 | TRACE_EVENT(ext4_mb_release_group_pa, |
| 425 | TP_PROTO(struct ext4_allocation_context *ac, | 427 | TP_PROTO(struct super_block *sb, |
| 428 | struct ext4_allocation_context *ac, | ||
| 426 | struct ext4_prealloc_space *pa), | 429 | struct ext4_prealloc_space *pa), |
| 427 | 430 | ||
| 428 | TP_ARGS(ac, pa), | 431 | TP_ARGS(sb, ac, pa), |
| 429 | 432 | ||
| 430 | TP_STRUCT__entry( | 433 | TP_STRUCT__entry( |
| 431 | __field( dev_t, dev ) | 434 | __field( dev_t, dev ) |
| @@ -436,8 +439,9 @@ TRACE_EVENT(ext4_mb_release_group_pa, | |||
| 436 | ), | 439 | ), |
| 437 | 440 | ||
| 438 | TP_fast_assign( | 441 | TP_fast_assign( |
| 439 | __entry->dev = ac->ac_sb->s_dev; | 442 | __entry->dev = sb->s_dev; |
| 440 | __entry->ino = ac->ac_inode->i_ino; | 443 | __entry->ino = (ac && ac->ac_inode) ? |
| 444 | ac->ac_inode->i_ino : 0; | ||
| 441 | __entry->pa_pstart = pa->pa_pstart; | 445 | __entry->pa_pstart = pa->pa_pstart; |
| 442 | __entry->pa_len = pa->pa_len; | 446 | __entry->pa_len = pa->pa_len; |
| 443 | ), | 447 | ), |
