Project

General

Profile

Bug #215 ยป 0001-batman-adv-fix-kernel-crash-due-to-missing-NULL-chec.patch

Marek Lindner, 06/09/2015 03:29 PM

View differences:

soft-interface.c
455 455
 */
456 456
void batadv_softif_vlan_free_ref(struct batadv_softif_vlan *vlan)
457 457
{
458
	if (!vlan)
459
		return;
460

  
458 461
	if (atomic_dec_and_test(&vlan->refcount)) {
459 462
		spin_lock_bh(&vlan->bat_priv->softif_vlan_list_lock);
460 463
		hlist_del_rcu(&vlan->list);
translation-table.c
575 575

  
576 576
	/* increase the refcounter of the related vlan */
577 577
	vlan = batadv_softif_vlan_get(bat_priv, vid);
578
	if (!vlan)
579
		goto out;
578 580

  
579 581
	batadv_dbg(BATADV_DBG_TT, bat_priv,
580 582
		   "Creating new local tt entry: %pM (vid: %d, ttvn: %d)\n",
......
1047 1049

  
1048 1050
	/* decrease the reference held for this vlan */
1049 1051
	vlan = batadv_softif_vlan_get(bat_priv, vid);
1052
	if (!vlan)
1053
		goto out;
1054

  
1050 1055
	batadv_softif_vlan_free_ref(vlan);
1051 1056
	batadv_softif_vlan_free_ref(vlan);
1052 1057

  
......
1147 1152
			/* decrease the reference held for this vlan */
1148 1153
			vlan = batadv_softif_vlan_get(bat_priv,
1149 1154
						      tt_common_entry->vid);
1150
			batadv_softif_vlan_free_ref(vlan);
1151
			batadv_softif_vlan_free_ref(vlan);
1155
			if (vlan) {
1156
				batadv_softif_vlan_free_ref(vlan);
1157
				batadv_softif_vlan_free_ref(vlan);
1158
			}
1152 1159

  
1153 1160
			batadv_tt_local_entry_free_ref(tt_local);
1154 1161
		}
......
3188 3195

  
3189 3196
			/* decrease the reference held for this vlan */
3190 3197
			vlan = batadv_softif_vlan_get(bat_priv, tt_common->vid);
3191
			batadv_softif_vlan_free_ref(vlan);
3192
			batadv_softif_vlan_free_ref(vlan);
3198
			if (vlan) {
3199
				batadv_softif_vlan_free_ref(vlan);
3200
				batadv_softif_vlan_free_ref(vlan);
3201
			}
3193 3202

  
3194 3203
			batadv_tt_local_entry_free_ref(tt_local);
3195 3204
		}
3196
- 
    (1-1/1)