5
5
* entry allocation and free, entry commit and get entry info.
6
6
*/
7
7
/*
8
- * Copyright: (c) 2018 Broadcom. All Rights Reserved. "Broadcom" refers to
8
+ * Copyright: (c) 2018 Broadcom. All Rights Reserved. "Broadcom" refers to
9
9
* Broadcom Limited and/or its subsidiaries.
10
- *
10
+ *
11
11
* Broadcom Switch Software License
12
- *
13
- * This license governs the use of the accompanying Broadcom software. Your
14
- * use of the software indicates your acceptance of the terms and conditions
15
- * of this license. If you do not agree to the terms and conditions of this
12
+ *
13
+ * This license governs the use of the accompanying Broadcom software. Your
14
+ * use of the software indicates your acceptance of the terms and conditions
15
+ * of this license. If you do not agree to the terms and conditions of this
16
16
* license, do not use the software.
17
17
* 1. Definitions
18
18
* "Licensor" means any person or entity that distributes its Work.
19
- * "Software" means the original work of authorship made available under
19
+ * "Software" means the original work of authorship made available under
20
20
* this license.
21
- * "Work" means the Software and any additions to or derivative works of
21
+ * "Work" means the Software and any additions to or derivative works of
22
22
* the Software that are made available under this license.
23
- * The terms "reproduce," "reproduction," "derivative works," and
23
+ * The terms "reproduce," "reproduction," "derivative works," and
24
24
* "distribution" have the meaning as provided under U.S. copyright law.
25
- * Works, including the Software, are "made available" under this license
26
- * by including in or with the Work either (a) a copyright notice
27
- * referencing the applicability of this license to the Work, or (b) a copy
25
+ * Works, including the Software, are "made available" under this license
26
+ * by including in or with the Work either (a) a copyright notice
27
+ * referencing the applicability of this license to the Work, or (b) a copy
28
28
* of this license.
29
29
* 2. Grant of Copyright License
30
- * Subject to the terms and conditions of this license, each Licensor
31
- * grants to you a perpetual, worldwide, non-exclusive, and royalty-free
32
- * copyright license to reproduce, prepare derivative works of, publicly
33
- * display, publicly perform, sublicense and distribute its Work and any
30
+ * Subject to the terms and conditions of this license, each Licensor
31
+ * grants to you a perpetual, worldwide, non-exclusive, and royalty-free
32
+ * copyright license to reproduce, prepare derivative works of, publicly
33
+ * display, publicly perform, sublicense and distribute its Work and any
34
34
* resulting derivative works in any form.
35
35
* 3. Grant of Patent License
36
- * Subject to the terms and conditions of this license, each Licensor
37
- * grants to you a perpetual, worldwide, non-exclusive, and royalty-free
38
- * patent license to make, have made, use, offer to sell, sell, import, and
39
- * otherwise transfer its Work, in whole or in part. This patent license
40
- * applies only to the patent claims licensable by Licensor that would be
41
- * infringed by Licensor's Work (or portion thereof) individually and
36
+ * Subject to the terms and conditions of this license, each Licensor
37
+ * grants to you a perpetual, worldwide, non-exclusive, and royalty-free
38
+ * patent license to make, have made, use, offer to sell, sell, import, and
39
+ * otherwise transfer its Work, in whole or in part. This patent license
40
+ * applies only to the patent claims licensable by Licensor that would be
41
+ * infringed by Licensor's Work (or portion thereof) individually and
42
42
* excluding any combinations with any other materials or technology.
43
- * If you institute patent litigation against any Licensor (including a
44
- * cross-claim or counterclaim in a lawsuit) to enforce any patents that
45
- * you allege are infringed by any Work, then your patent license from such
46
- * Licensor to the Work shall terminate as of the date such litigation is
43
+ * If you institute patent litigation against any Licensor (including a
44
+ * cross-claim or counterclaim in a lawsuit) to enforce any patents that
45
+ * you allege are infringed by any Work, then your patent license from such
46
+ * Licensor to the Work shall terminate as of the date such litigation is
47
47
* filed.
48
48
* 4. Redistribution
49
- * You may reproduce or distribute the Work only if (a) you do so under
50
- * this License, (b) you include a complete copy of this License with your
51
- * distribution, and (c) you retain without modification any copyright,
49
+ * You may reproduce or distribute the Work only if (a) you do so under
50
+ * this License, (b) you include a complete copy of this License with your
51
+ * distribution, and (c) you retain without modification any copyright,
52
52
* patent, trademark, or attribution notices that are present in the Work.
53
53
* 5. Derivative Works
54
- * You may specify that additional or different terms apply to the use,
55
- * reproduction, and distribution of your derivative works of the Work
56
- * ("Your Terms") only if (a) Your Terms provide that the limitations of
57
- * Section 7 apply to your derivative works, and (b) you identify the
58
- * specific derivative works that are subject to Your Terms.
59
- * Notwithstanding Your Terms, this license (including the redistribution
54
+ * You may specify that additional or different terms apply to the use,
55
+ * reproduction, and distribution of your derivative works of the Work
56
+ * ("Your Terms") only if (a) Your Terms provide that the limitations of
57
+ * Section 7 apply to your derivative works, and (b) you identify the
58
+ * specific derivative works that are subject to Your Terms.
59
+ * Notwithstanding Your Terms, this license (including the redistribution
60
60
* requirements in Section 4) will continue to apply to the Work itself.
61
61
* 6. Trademarks
62
- * This license does not grant any rights to use any Licensor's or its
63
- * affiliates' names, logos, or trademarks, except as necessary to
62
+ * This license does not grant any rights to use any Licensor's or its
63
+ * affiliates' names, logos, or trademarks, except as necessary to
64
64
* reproduce the notices described in this license.
65
65
* 7. Limitations
66
- * Platform. The Work and any derivative works thereof may only be used, or
66
+ * Platform. The Work and any derivative works thereof may only be used, or
67
67
* intended for use, with a Broadcom switch integrated circuit.
68
- * No Reverse Engineering. You will not use the Work to disassemble,
69
- * reverse engineer, decompile, or attempt to ascertain the underlying
68
+ * No Reverse Engineering. You will not use the Work to disassemble,
69
+ * reverse engineer, decompile, or attempt to ascertain the underlying
70
70
* technology of a Broadcom switch integrated circuit.
71
71
* 8. Termination
72
- * If you violate any term of this license, then your rights under this
73
- * license (including the license grants of Sections 2 and 3) will
72
+ * If you violate any term of this license, then your rights under this
73
+ * license (including the license grants of Sections 2 and 3) will
74
74
* terminate immediately.
75
75
* 9. Disclaimer of Warranty
76
- * THE WORK IS PROVIDED "AS IS" WITHOUT WARRANTIES OR CONDITIONS OF ANY
77
- * KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WARRANTIES OR CONDITIONS OF
78
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR
79
- * NON-INFRINGEMENT. YOU BEAR THE RISK OF UNDERTAKING ANY ACTIVITIES UNDER
80
- * THIS LICENSE. SOME STATES' CONSUMER LAWS DO NOT ALLOW EXCLUSION OF AN
76
+ * THE WORK IS PROVIDED "AS IS" WITHOUT WARRANTIES OR CONDITIONS OF ANY
77
+ * KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WARRANTIES OR CONDITIONS OF
78
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE OR
79
+ * NON-INFRINGEMENT. YOU BEAR THE RISK OF UNDERTAKING ANY ACTIVITIES UNDER
80
+ * THIS LICENSE. SOME STATES' CONSUMER LAWS DO NOT ALLOW EXCLUSION OF AN
81
81
* IMPLIED WARRANTY, SO THIS DISCLAIMER MAY NOT APPLY TO YOU.
82
82
* 10. Limitation of Liability
83
- * EXCEPT AS PROHIBITED BY APPLICABLE LAW, IN NO EVENT AND UNDER NO LEGAL
84
- * THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE
85
- * SHALL ANY LICENSOR BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT,
86
- * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
87
- * OR RELATED TO THIS LICENSE, THE USE OR INABILITY TO USE THE WORK
88
- * (INCLUDING BUT NOT LIMITED TO LOSS OF GOODWILL, BUSINESS INTERRUPTION,
89
- * LOST PROFITS OR DATA, COMPUTER FAILURE OR MALFUNCTION, OR ANY OTHER
90
- * COMMERCIAL DAMAGES OR LOSSES), EVEN IF THE LICENSOR HAS BEEN ADVISED OF
83
+ * EXCEPT AS PROHIBITED BY APPLICABLE LAW, IN NO EVENT AND UNDER NO LEGAL
84
+ * THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE
85
+ * SHALL ANY LICENSOR BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT,
86
+ * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF
87
+ * OR RELATED TO THIS LICENSE, THE USE OR INABILITY TO USE THE WORK
88
+ * (INCLUDING BUT NOT LIMITED TO LOSS OF GOODWILL, BUSINESS INTERRUPTION,
89
+ * LOST PROFITS OR DATA, COMPUTER FAILURE OR MALFUNCTION, OR ANY OTHER
90
+ * COMMERCIAL DAMAGES OR LOSSES), EVEN IF THE LICENSOR HAS BEEN ADVISED OF
91
91
* THE POSSIBILITY OF SUCH DAMAGES.
92
92
*/
93
93
@@ -180,7 +180,7 @@ int bcmlt_entry_allocate(int unit,
180
180
if (!table_name || !entry_hdl ) {
181
181
LOG_VERBOSE (BSL_LOG_MODULE ,
182
182
(BSL_META_U (unit ,
183
- "Table name and entry handle shouln 't" \
183
+ "Table name and entry handle shouldn 't" \
184
184
" be NULL\n" )));
185
185
SHR_RETURN_VAL_EXIT (SHR_E_PARAM );
186
186
}
@@ -199,6 +199,13 @@ int bcmlt_entry_allocate(int unit,
199
199
table_attr -> name );
200
200
SHR_NULL_CHECK (entry , SHR_E_MEMORY );
201
201
entry -> db_hdl = hdl ;
202
+ #if defined(__SANITIZE_ADDRESS__ ) || __has_feature (address_sanitizer )
203
+ entry -> dummy = malloc (1 );
204
+ #endif
205
+
206
+ #if defined(__SANITIZE_ADDRESS__ ) || __has_feature (address_sanitizer )
207
+ asdf
208
+ #endif
202
209
/* Clean the fields array */
203
210
if (fld_array_hdl ) {
204
211
sal_memset (entry -> fld_arr , 0 , sizeof (void * ) * (table_attr -> max_fid + 1 ));
@@ -277,6 +284,10 @@ int bcmlt_entry_free(bcmlt_entry_handle_t entry_hdl)
277
284
SHR_RETURN_VAL_EXIT (SHR_E_BUSY );
278
285
}
279
286
287
+ #ifdef __SANITIZE_ADDRESS__ || __has_feature (address_sanitizer )
288
+ free (entry -> dummy );
289
+ #endif
290
+
280
291
SHR_IF_ERR_EXIT (bcmlt_hdl_free (entry_hdl ));
281
292
282
293
SHR_IF_ERR_EXIT (bcmtrm_entry_free (entry ));
0 commit comments